mirror of
https://github.com/neovim/neovim.git
synced 2026-10-25 23:20:23 -05:00
fix(ui2): entering the pager fails if <ESC> is remapped to :fclose (#39462)
Problem: Entering the pager fails if <ESC> is remapped to :fclose by user.
Solution: Avoid executing mappings with nvim_feedkeys() that closes expanded cmdline.
(cherry picked from commit 2b7a00746d)
This commit is contained in:
1 parent
13041a067e
commit
70f22713a1
2 files changed
+2
-1
No files matched your search
@@ -600,7 +600,7 @@ local function enter_pager()
|
|||||||
if was_cmdwin ~= '' then
|
if was_cmdwin ~= '' then
|
||||||
api.nvim_command('quit')
|
api.nvim_command('quit')
|
||||||
elseif M.cmd_on_key then
|
elseif M.cmd_on_key then
|
||||||
api.nvim_feedkeys(vim.keycode('<Esc>'), 't', false)
|
api.nvim_feedkeys(vim.keycode('<Esc>'), 'tn', false)
|
||||||
end
|
end
|
||||||
-- Cmdwin is closed one event iteration later so schedule in case it was open.
|
-- Cmdwin is closed one event iteration later so schedule in case it was open.
|
||||||
vim.schedule(function()
|
vim.schedule(function()
|
||||||
|
|||||||
@@ -180,6 +180,7 @@ describe('messages2', function()
|
|||||||
foo [+9] |
|
foo [+9] |
|
||||||
]])
|
]])
|
||||||
-- Do enter the pager in normal mode.
|
-- Do enter the pager in normal mode.
|
||||||
|
command('nmap <Esc> <Cmd>fclose<CR>')
|
||||||
feed('<CR>')
|
feed('<CR>')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
^foo |
|
^foo |
|
||||||
|
|||||||
Reference in new issue
Block a user