neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 78d2e0b43e7a8dccbd4444a7d11e55d8f9a2d71b
parent 874e2149931f40c41c470c2a6ca6c6719fab4c4d
Author: phanium <91544758+phanen@users.noreply.github.com>
Date:   Sat, 29 Mar 2025 20:55:17 +0800

fix(checkhealth): don't override user "q" keymap #33132


Diffstat:
Mruntime/lua/vim/health.lua | 12++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/runtime/lua/vim/health.lua b/runtime/lua/vim/health.lua @@ -449,11 +449,15 @@ function M._check(mods, plugin_names) vim.print('') -- Quit with 'q' inside healthcheck buffers. - vim.keymap.set('n', 'q', function() - if not pcall(vim.cmd.close) then - vim.cmd.bdelete() + vim._with({ buf = bufnr }, function() + if vim.fn.maparg('q', 'n', false, false) == '' then + vim.keymap.set('n', 'q', function() + if not pcall(vim.cmd.close) then + vim.cmd.bdelete() + end + end, { buffer = bufnr, silent = true, noremap = true, nowait = true }) end - end, { buffer = bufnr, silent = true, noremap = true, nowait = true }) + end) -- Once we're done writing checks, set nomodifiable. vim.bo[bufnr].modifiable = false