fix(runtime): stop treesitter highlight in b:undo_ftplugin (#29533)

It seems that nvim-treesitter stops treesitter highlight when changing
filetype, so it makes sense for builtin ftplugins to do this as well.

Use :call and v:lua here to allow separation with '|'.
This commit is contained in:
zeertzjq
2024-07-03 15:24:12 +08:00
committed by GitHub
parent 599fc7cee4
commit 12c9791e0f
5 changed files with 10 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
-- Neovim filetype plugin file
-- Language: Treesitter query
-- Last Change: 2023 Aug 23
-- Last Change: 2024 Jul 03
if vim.b.did_ftplugin == 1 then
return
@@ -32,6 +32,7 @@ if not vim.b.disable_query_linter and #query_lint_on > 0 then
end
-- it's a lisp!
vim.cmd([[ runtime! ftplugin/lisp.vim ]])
vim.cmd([[runtime! ftplugin/lisp.vim]])
vim.b.undo_ftplugin = vim.b.undo_ftplugin .. ' | setl omnifunc< iskeyword<'
vim.b.undo_ftplugin = vim.b.undo_ftplugin .. ' | call v:lua.vim.treesitter.stop()'