aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/normal.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-04-18 08:33:08 +0800
committerGitHub <noreply@github.com>2024-04-18 08:33:08 +0800
commite1ca7a7bfc954fae6991fc86d5da1a4eda864903 (patch)
tree26998b867ed1fc2fb12a1e436ecd1fe3ea9dcb67 /src/nvim/normal.c
parent562719033ec8bec9f6d56c166b9aef13f8a50a96 (diff)
downloadrneovim-e1ca7a7bfc954fae6991fc86d5da1a4eda864903.tar.gz
rneovim-e1ca7a7bfc954fae6991fc86d5da1a4eda864903.tar.bz2
rneovim-e1ca7a7bfc954fae6991fc86d5da1a4eda864903.zip
test: 'showcmd' with ext_messages and Visual selection (#28393)
Also slightly reorder some code to make comments look less out-of-place.
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r--src/nvim/normal.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index 22b1c8dffa..d90e23240c 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -893,8 +893,8 @@ static bool normal_get_command_count(NormalState *s)
// Handle a count before a command and compute ca.count0.
// Note that '0' is a command and not the start of a count, but it's
// part of a count after other digits.
- while ((s->c >= '1' && s->c <= '9') || (s->ca.count0 != 0
- && (s->c == K_DEL || s->c == K_KDEL || s->c == '0'))) {
+ while ((s->c >= '1' && s->c <= '9')
+ || (s->ca.count0 != 0 && (s->c == K_DEL || s->c == K_KDEL || s->c == '0'))) {
if (s->c == K_DEL || s->c == K_KDEL) {
s->ca.count0 /= 10;
del_from_showcmd(4); // delete the digit and ~@%
@@ -2065,9 +2065,6 @@ 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);
@@ -2081,6 +2078,9 @@ static void display_showcmd(void)
ui_call_msg_showcmd(content);
return;
}
+ if (p_ch == 0) {
+ return;
+ }
msg_grid_validate();
int showcmd_row = Rows - 1;