summaryrefslogtreecommitdiffstatshomepage
path: root/runtime/lua/vim/_extui/shared.lua
diff options
context:
space:
mode:
authorphanium <91544758+phanen@users.noreply.github.com>2025-06-20 23:32:07 +0800
committerGitHub <noreply@github.com>2025-06-20 17:32:07 +0200
commitd0aedd36dfe0ac4ed45ea93f471379c77f0c7905 (patch)
tree1a3e457816eed59b630980e35da6f36bb7784738 /runtime/lua/vim/_extui/shared.lua
parentcacb4ceeb44d5a29382b0cb37256a6a711aa7ecc (diff)
fix(extui): set 'modifiable', 'noswapfile' for buffers (#34582)
Problem: UI buffers may be 'unmodifiable' and use a 'swapfile'. Solution: Set the 'modifiable' and 'noswapfile' options. Co-authored-by:phanium <91544758+phanen@users.noreply.github.com>
Diffstat (limited to 'runtime/lua/vim/_extui/shared.lua')
-rw-r--r--runtime/lua/vim/_extui/shared.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/runtime/lua/vim/_extui/shared.lua b/runtime/lua/vim/_extui/shared.lua
index 8fe494db48..0045748039 100644
--- a/runtime/lua/vim/_extui/shared.lua
+++ b/runtime/lua/vim/_extui/shared.lua
@@ -77,6 +77,8 @@ function M.tab_check_wins()
if setopt then
local name = { cmd = 'Cmd', dialog = 'Dialog', msg = 'Msg', pager = 'Pager' }
api.nvim_buf_set_name(M.bufs[type], ('[%s]'):format(name[type]))
+ api.nvim_set_option_value('swapfile', false, { buf = M.bufs[type] })
+ api.nvim_set_option_value('modifiable', true, { buf = M.bufs[type] })
if type == 'pager' then
-- Close pager with `q`, same as `checkhealth`
api.nvim_buf_set_keymap(M.bufs.pager, 'n', 'q', '<Cmd>wincmd c<CR>', {})