aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorluukvbaal <luukvbaal@gmail.com>2025-03-28 12:52:57 +0100
committerGitHub <noreply@github.com>2025-03-28 04:52:57 -0700
commit95ab723995f1cc1a11c62355fbac64597526d47e (patch)
tree2e9ae5f955d2d11517f6dc1a4d4ab8d23c0b80cf /test/functional
parentade58885c478a46c1299f23f17a5c40e2960b6ad (diff)
downloadrneovim-95ab723995f1cc1a11c62355fbac64597526d47e.tar.gz
rneovim-95ab723995f1cc1a11c62355fbac64597526d47e.tar.bz2
rneovim-95ab723995f1cc1a11c62355fbac64597526d47e.zip
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`.
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/ui/cmdline_spec.lua25
1 files changed, 19 insertions, 6 deletions
diff --git a/test/functional/ui/cmdline_spec.lua b/test/functional/ui/cmdline_spec.lua
index 59c8be3d5e..067be3b8d4 100644
--- a/test/functional/ui/cmdline_spec.lua
+++ b/test/functional/ui/cmdline_spec.lua
@@ -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' } }, { { ' ' } } },
+ })
+ feed('endif')
+ screen:expect({
+ grid = s1,
+ cmdline = {
+ {
+ content = { { 'endif' } },
+ firstc = ':',
+ indent = 2,
+ pos = 5,
},
},
- cmdline_block = { { { 'if 1' } }, { { ' :let x = 1' } } },
+ cmdline_block = { { { 'if 1' } }, { { ' let x = 1' } }, { { ' ' } } },
})
feed('<CR>')
screen:expect({