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:
parent
149d12e824
commit
ff7c28490d
1 changed files with 1 additions and 1 deletions
|
|
@ -37,7 +37,7 @@ controller.update = function(text)
|
||||||
if #text > 0 then
|
if #text > 0 then
|
||||||
-- Escape characters so they do not throw an error when vim tries to use
|
-- Escape characters so they do not throw an error when vim tries to use
|
||||||
-- the "text" as a regex
|
-- 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 .. "]'")
|
vim.cmd("syntax match IvyMatch '[" .. escaped_text .. "]'")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue