Skip to content

Commit

Permalink
fix(treesitter): escape things like " in omnifunc results
Browse files Browse the repository at this point in the history
  • Loading branch information
ribru17 authored and clason committed Aug 27, 2024
1 parent d9ccd82 commit f8e1ebd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion runtime/lua/vim/treesitter/_query_linter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f8e1ebd

Please sign in to comment.