diff options
-rw-r--r-- | src/nvim/normal.c | 3 | ||||
-rw-r--r-- | test/functional/ui/cmdline_spec.lua | 13 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 1f7cc6c4f6..7979d2502e 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -1990,6 +1990,9 @@ static void display_showcmd(void) return; } // 'showcmdloc' is "last" or empty + if (p_ch == 0 && !ui_has(kUIMessages)) { + return; + } if (ui_has(kUIMessages)) { MAXSIZE_TEMP_ARRAY(content, 1); diff --git a/test/functional/ui/cmdline_spec.lua b/test/functional/ui/cmdline_spec.lua index c73c2d9f8a..1bdd55d66b 100644 --- a/test/functional/ui/cmdline_spec.lua +++ b/test/functional/ui/cmdline_spec.lua @@ -1351,4 +1351,17 @@ describe('cmdheight=0', function() {1:~ }│{1:~ }| ]]) end) + + it('no assert failure with showcmd', function() + command('set showcmd cmdheight=0') + feed('d') + screen:expect([[ + ^ | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + ]]) + assert_alive() + end) end) |