diff options
author | Riley Bruins <ribru17@hotmail.com> | 2024-08-26 20:40:37 -0700 |
---|---|---|
committer | Christian Clason <c.clason@uni-graz.at> | 2024-08-27 09:27:47 +0200 |
commit | f8e1ebd6f62662129fdb54574b305189e4a0b7af (patch) | |
tree | d190b4273be3ec26bb2da4340eec6318c8658df8 | |
parent | d9ccd828b0d46754b9bcb9b17f47c2a51968db05 (diff) | |
download | rneovim-f8e1ebd6f62662129fdb54574b305189e4a0b7af.tar.gz rneovim-f8e1ebd6f62662129fdb54574b305189e4a0b7af.tar.bz2 rneovim-f8e1ebd6f62662129fdb54574b305189e4a0b7af.zip |
fix(treesitter): escape things like `"` in omnifunc results
-rw-r--r-- | runtime/lua/vim/treesitter/_query_linter.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/lua/vim/treesitter/_query_linter.lua b/runtime/lua/vim/treesitter/_query_linter.lua index 6b8c3a17f2..8654b89c9b 100644 --- a/runtime/lua/vim/treesitter/_query_linter.lua +++ b/runtime/lua/vim/treesitter/_query_linter.lua @@ -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 |