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:
zeertzjq
2024-09-23 16:49:34 +08:00
committed by GitHub
parent 423176db56
commit 5057753431
13 changed files with 18 additions and 8 deletions

View File

@@ -31,5 +31,5 @@ vim.keymap.set('n', 'gO', function()
require('vim.vimhelp').show_toc()
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 .. ' | nunmap <buffer> gO'