mirror of
https://github.com/neovim/neovim.git
synced 2025-10-09 19:36:40 +00:00
fix(messages): recognize cmdline one_key/number prompt State (#34206)
Problem: Since 48e2a736
, prompt messages are handled by an actual
active cmdline, resulting in `State` no longer being equal
to `MODE_CONFIRM` which is used in some places. E.g. to
specify the current `mode()` or to re-emit a confirm message.
Solution: Replace `MODE_CONFIRM` with a new `MODE_CMDLINE` sub-mode when
`ccline.one_key/mouse_used` is set. Use it to avoid clearing
mouse_used prompt messages, and to re-emit one_key messages
(when ext_messages is inactive, for which this is unnecessary).
This commit is contained in:
@@ -2157,6 +2157,11 @@ describe('API', function()
|
||||
feed('<F2>')
|
||||
eq({ mode = 'n', blocking = false }, api.nvim_get_mode())
|
||||
end)
|
||||
|
||||
it('returns "c" during number prompt', function()
|
||||
feed('ifoo<Esc>z=')
|
||||
eq({ mode = 'c', blocking = false }, api.nvim_get_mode())
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('RPC (K_EVENT)', function()
|
||||
|
Reference in New Issue
Block a user