fix: escape \ when running shell commands

This is causing an issue when running shell commands though ivy and
trying to escape chars is in strings or regexes.
This commit is contained in:
Ade Attwood 2023-04-25 20:14:52 +01:00
parent 149d12e824
commit ff7c28490d

View file

@ -37,7 +37,7 @@ controller.update = function(text)
if #text > 0 then
-- Escape characters so they do not throw an error when vim tries to use
-- the "text" as a regex
local escaped_text = string.gsub(text, "([-/])", "\\%1")
local escaped_text = string.gsub(text, "([-/\\])", "\\%1")
vim.cmd("syntax match IvyMatch '[" .. escaped_text .. "]'")
end
end)