mirror of
https://github.com/neovim/neovim
synced 2025-07-16 09:11:51 +00:00
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.
This commit is contained in:
@ -1 +1,3 @@
|
|||||||
vim.bo.commentstring = '// %s'
|
vim.bo.commentstring = '// %s'
|
||||||
|
|
||||||
|
vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n setl commentstring<'
|
||||||
|
@ -11,4 +11,4 @@ if vim.fn.isdirectory('/usr/include') == 1 then
|
|||||||
]])
|
]])
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.b.undo_ftplugin = vim.b.undo_ftplugin .. ' | setl path<'
|
vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n setl commentstring< define< include< path<'
|
||||||
|
@ -1 +1,3 @@
|
|||||||
vim.bo.commentstring = '// %s'
|
vim.bo.commentstring = '// %s'
|
||||||
|
|
||||||
|
vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n setl commentstring<'
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
vim.bo.commentstring = '// %s'
|
vim.bo.commentstring = '// %s'
|
||||||
|
|
||||||
vim.b.undo_ftplugin = vim.b.undo_ftplugin .. ' | setl commentstring<'
|
vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n setl commentstring<'
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
vim.bo.commentstring = '// %s'
|
vim.bo.commentstring = '// %s'
|
||||||
|
|
||||||
vim.b.undo_ftplugin = 'setl commentstring<'
|
vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n setl commentstring<'
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
vim.bo.commentstring = '// %s'
|
vim.bo.commentstring = '// %s'
|
||||||
|
|
||||||
vim.b.undo_ftplugin = 'setl commentstring<'
|
vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n setl commentstring<'
|
||||||
|
@ -31,5 +31,5 @@ vim.keymap.set('n', 'gO', function()
|
|||||||
require('vim.vimhelp').show_toc()
|
require('vim.vimhelp').show_toc()
|
||||||
end, { buffer = 0, silent = true })
|
end, { buffer = 0, silent = true })
|
||||||
|
|
||||||
|
vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n exe "nunmap <buffer> gO"'
|
||||||
vim.b.undo_ftplugin = vim.b.undo_ftplugin .. ' | call v:lua.vim.treesitter.stop()'
|
vim.b.undo_ftplugin = vim.b.undo_ftplugin .. ' | call v:lua.vim.treesitter.stop()'
|
||||||
vim.b.undo_ftplugin = vim.b.undo_ftplugin .. ' | nunmap <buffer> gO'
|
|
||||||
|
@ -1 +1,3 @@
|
|||||||
vim.bo.commentstring = '// %s'
|
vim.bo.commentstring = '// %s'
|
||||||
|
|
||||||
|
vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n setl commentstring<'
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
-- use treesitter over syntax
|
-- use treesitter over syntax
|
||||||
vim.treesitter.start()
|
vim.treesitter.start()
|
||||||
|
|
||||||
vim.b.undo_ftplugin = vim.b.undo_ftplugin .. ' | call v:lua.vim.treesitter.stop()'
|
vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n call v:lua.vim.treesitter.stop()'
|
||||||
|
@ -1 +1,3 @@
|
|||||||
vim.bo.commentstring = '// %s'
|
vim.bo.commentstring = '// %s'
|
||||||
|
|
||||||
|
vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n setl commentstring<'
|
||||||
|
@ -34,5 +34,5 @@ end
|
|||||||
-- it's a lisp!
|
-- 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 or '') .. '\n setl omnifunc< iskeyword<'
|
||||||
vim.b.undo_ftplugin = vim.b.undo_ftplugin .. ' | call v:lua.vim.treesitter.stop()'
|
vim.b.undo_ftplugin = vim.b.undo_ftplugin .. ' | call v:lua.vim.treesitter.stop()'
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
vim.bo.commentstring = '// %s'
|
vim.bo.commentstring = '// %s'
|
||||||
|
|
||||||
vim.b.undo_ftplugin = vim.b.undo_ftplugin .. ' | setl commentstring<'
|
vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n setl commentstring<'
|
||||||
|
@ -1 +1,3 @@
|
|||||||
vim.bo.commentstring = '// %s'
|
vim.bo.commentstring = '// %s'
|
||||||
|
|
||||||
|
vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n setl commentstring<'
|
||||||
|
Reference in New Issue
Block a user