mirror of
https://github.com/neovim/neovim
synced 2025-07-18 02:01:46 +00:00
fix(treesitter): escape things like "
in omnifunc results
(cherry picked from commit f8e1ebd6f6
)
This commit is contained in:
committed by
Christian Clason
parent
d593b20017
commit
a6b2233c3e
@ -241,7 +241,7 @@ function M.omnifunc(findstart, base)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
for _, s in pairs(parser_info.symbols) do
|
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
|
if text:find(base, 1, true) then
|
||||||
table.insert(items, text)
|
table.insert(items, text)
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user