mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 05:58:33 +00:00
fix(cmdline): empty ext_cmdline block events for :<CR> #33118
Problem: An ext_cmdline block event that should be empty after :<CR>
re-emits the previous cmdline.
Solution: Clear `last_cmdline` even when `new_last_cmdline == NULL`.
(cherry picked from commit 95ab723995
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
c61e8c6e70
commit
53def2a877
@@ -886,7 +886,7 @@ local function test_cmdline(linegrid)
|
||||
},
|
||||
cmdline_block = { { { 'if 1' } } },
|
||||
})
|
||||
feed(':let x = 1<CR>')
|
||||
feed('let x = 1<CR>')
|
||||
screen:expect({
|
||||
grid = s1,
|
||||
cmdline = {
|
||||
@@ -897,20 +897,33 @@ local function test_cmdline(linegrid)
|
||||
pos = 0,
|
||||
},
|
||||
},
|
||||
cmdline_block = { { { 'if 1' } }, { { ' :let x = 1' } } },
|
||||
cmdline_block = { { { 'if 1' } }, { { ' let x = 1' } } },
|
||||
})
|
||||
feed(':endif')
|
||||
feed('<CR>')
|
||||
screen:expect({
|
||||
grid = s1,
|
||||
cmdline = {
|
||||
{
|
||||
content = { { ':endif' } },
|
||||
content = { { '' } },
|
||||
firstc = ':',
|
||||
indent = 2,
|
||||
pos = 6,
|
||||
pos = 0,
|
||||
},
|
||||
},
|
||||
cmdline_block = { { { 'if 1' } }, { { ' :let x = 1' } } },
|
||||
cmdline_block = { { { 'if 1' } }, { { ' let x = 1' } }, { { ' ' } } },
|
||||
})
|
||||
feed('endif')
|
||||
screen:expect({
|
||||
grid = s1,
|
||||
cmdline = {
|
||||
{
|
||||
content = { { 'endif' } },
|
||||
firstc = ':',
|
||||
indent = 2,
|
||||
pos = 5,
|
||||
},
|
||||
},
|
||||
cmdline_block = { { { 'if 1' } }, { { ' let x = 1' } }, { { ' ' } } },
|
||||
})
|
||||
feed('<CR>')
|
||||
screen:expect({
|
||||
|
Reference in New Issue
Block a user