mirror of
https://github.com/neovim/neovim.git
synced 2026-08-29 18:41:48 +00:00
fix(messages): recognize cmdline one_key/number prompt State (#34206)
Problem: Since48e2a736, 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). (cherry picked from commite876a739ee)
This commit is contained in:
committed by
github-actions[bot]
parent
adf31505d8
commit
89959ab9dc
@@ -1106,7 +1106,7 @@ describe('cmdline redraw', function()
|
||||
}
|
||||
end)
|
||||
|
||||
it('silent prompt', function()
|
||||
it('prompt with silent mapping and screen update', function()
|
||||
command([[nmap <silent> T :call confirm("Save changes?", "&Yes\n&No\n&Cancel")<CR>]])
|
||||
feed('T')
|
||||
screen:expect([[
|
||||
@@ -1116,6 +1116,31 @@ describe('cmdline redraw', function()
|
||||
{6:Save changes?} |
|
||||
{6:[Y]es, (N)o, (C)ancel: }^ |
|
||||
]])
|
||||
command('call setline(1, "foo") | redraw')
|
||||
screen:expect([[
|
||||
foo |
|
||||
{3: }|
|
||||
|
|
||||
{6:Save changes?} |
|
||||
{6:[Y]es, (N)o, (C)ancel: }^ |
|
||||
]])
|
||||
feed('Y')
|
||||
screen:expect([[
|
||||
^foo |
|
||||
{1:~ }|*3
|
||||
|
|
||||
]])
|
||||
screen:try_resize(75, screen._height)
|
||||
feed(':call inputlist(["foo", "bar"])<CR>')
|
||||
screen:expect([[
|
||||
foo |
|
||||
{3: }|
|
||||
foo |
|
||||
bar |
|
||||
Type number and <Enter> or click with the mouse (q or empty cancels): ^ |
|
||||
]])
|
||||
command('redraw')
|
||||
screen:expect_unchanged()
|
||||
end)
|
||||
|
||||
it('substitute confirm prompt does not scroll', function()
|
||||
|
||||
Reference in New Issue
Block a user