more special character optimizations for fish, skim

main
bhagwan 2 years ago
parent fdd3874367
commit aa9194f98d

@ -435,7 +435,7 @@ M.shellescape = function(s)
else
local ret = nil
vim.o.shell = "sh"
if not s:match([["]]) then
if not s:match([["]]) and not s:match([[\]]) then
-- if the original string does not contain double quotes
-- replace surrounding single quote with double quotes
-- temporarily replace all single quotes with double

@ -103,8 +103,8 @@ end
function M.rg_escape(str)
if not str then return str end
-- [(~'"\/$?'`*&&||;[]<>)]
-- escape "\~$?*|[()"
return str:gsub('[\\~$?*|{\\[()-]', function(x)
-- escape "\~$?*|[()-^"
return str:gsub('[\\~$?*|{\\[()%-^]', function(x)
return '\\' .. x
end)
end
@ -113,7 +113,7 @@ function M.sk_escape(str)
if not str then return str end
return str:gsub('["`]', function(x)
return '\\' .. x
end)
end):gsub([[\\]], [[\\\\]]):gsub([[\%$]], [[\\\$]])
end
function M.lua_escape(str)

Loading…
Cancel
Save