From 8f5e90811025bcc652146168d5116f8d73fe8f81 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 1 Jul 2024 17:48:09 +0800 Subject: fix(runtime): update b:undo_ftplugin in Lua runtime files (#29529) Related to #29506, but adding vim.treesitter.stop() to b:undo_ftplugin doesn't solve the problem yet. --- runtime/ftplugin/query.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'runtime/ftplugin/query.lua') diff --git a/runtime/ftplugin/query.lua b/runtime/ftplugin/query.lua index c75dc30430..499619e36f 100644 --- a/runtime/ftplugin/query.lua +++ b/runtime/ftplugin/query.lua @@ -33,3 +33,5 @@ end -- it's a lisp! vim.cmd([[ runtime! ftplugin/lisp.vim ]]) + +vim.b.undo_ftplugin = vim.b.undo_ftplugin .. ' | setl omnifunc< iskeyword<' -- cgit From 12c9791e0fef7ee0d6cf6d3b828caa488d6347ea Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 3 Jul 2024 15:24:12 +0800 Subject: 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 '|'. --- runtime/ftplugin/query.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'runtime/ftplugin/query.lua') diff --git a/runtime/ftplugin/query.lua b/runtime/ftplugin/query.lua index 499619e36f..945d441971 100644 --- a/runtime/ftplugin/query.lua +++ b/runtime/ftplugin/query.lua @@ -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()' -- cgit From 50577534318bbf8c1e22e80a74baa3b20c131ea8 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 23 Sep 2024 16:49:34 +0800 Subject: fix(runtime): treat b:undo_ftplugin consistently in Lua ftplugins (#30473) - Don't assume b:undo_ftplugin is set when first modifying it. - Don't assume b:undo_ftplugin already contains some resetting. --- runtime/ftplugin/query.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/ftplugin/query.lua') diff --git a/runtime/ftplugin/query.lua b/runtime/ftplugin/query.lua index 945d441971..32d615c65c 100644 --- a/runtime/ftplugin/query.lua +++ b/runtime/ftplugin/query.lua @@ -34,5 +34,5 @@ end -- it's a lisp! 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 or '') .. '\n setl omnifunc< iskeyword<' vim.b.undo_ftplugin = vim.b.undo_ftplugin .. ' | call v:lua.vim.treesitter.stop()' -- cgit