aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/normal.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r--src/nvim/normal.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index d90e23240c..2f1477b9d5 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -2043,8 +2043,7 @@ void pop_showcmd(void)
static void display_showcmd(void)
{
- int len = vim_strsize(showcmd_buf);
- showcmd_is_clear = (len == 0);
+ showcmd_is_clear = (showcmd_buf[0] == NUL);
if (*p_sloc == 's') {
if (showcmd_is_clear) {
@@ -2069,7 +2068,7 @@ static void display_showcmd(void)
if (ui_has(kUIMessages)) {
MAXSIZE_TEMP_ARRAY(content, 1);
MAXSIZE_TEMP_ARRAY(chunk, 2);
- if (len > 0) {
+ if (!showcmd_is_clear) {
// placeholder for future highlight support
ADD_C(chunk, INTEGER_OBJ(0));
ADD_C(chunk, CSTR_AS_OBJ(showcmd_buf));
@@ -2086,8 +2085,9 @@ static void display_showcmd(void)
int showcmd_row = Rows - 1;
grid_line_start(&msg_grid_adj, showcmd_row);
+ int len = 0;
if (!showcmd_is_clear) {
- grid_line_puts(sc_col, showcmd_buf, -1, HL_ATTR(HLF_MSG));
+ len = grid_line_puts(sc_col, showcmd_buf, -1, HL_ATTR(HLF_MSG));
}
// clear the rest of an old message by outputting up to SHOWCMD_COLS spaces