From ff7c28490d09a7e243f99c5c0f5e097c4815acd3 Mon Sep 17 00:00:00 2001 From: Ade Attwood Date: Tue, 25 Apr 2023 20:14:52 +0100 Subject: [PATCH] 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. --- lua/ivy/controller.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/ivy/controller.lua b/lua/ivy/controller.lua index 0af4afa..5c26303 100644 --- a/lua/ivy/controller.lua +++ b/lua/ivy/controller.lua @@ -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)