fix(treesitter): escape things like " in omnifunc results

This commit is contained in:
Riley Bruins authored and Christian Clason committed 2024-08-27 09:27:47 +02:00
1 parent d9ccd828b0
commit f8e1ebd6f6
1 file changed
+1 -1
+1 -1
View File
@@ -241,7 +241,7 @@ function M.omnifunc(findstart, base)
end
end
for _, s in pairs(parser_info.symbols) do
local text = s[2] and s[1] or '"' .. s[1]:gsub([[\]], [[\\]]) .. '"' ---@type string
local text = s[2] and s[1] or string.format('%q', s[1]):gsub('\n', 'n') ---@type string
if text:find(base, 1, true) then
table.insert(items, text)
end