From 8541312ec01c1660058021f8a56443ac0be87628 Mon Sep 17 00:00:00 2001 From: night0721 Date: Fri, 15 Nov 2024 10:32:30 +0000 Subject: [PATCH] Print running command --- vip.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vip.c b/vip.c index e253b93..a815c3f 100644 --- a/vip.c +++ b/vip.c @@ -1083,6 +1083,10 @@ int main(int argc, char **argv) case '8': case '9': action = COUNTING; cmd[cmd_len++] = c; + cmd[cmd_len] = '\0'; + /* cmd occupy 10 char and add a trailing space*/ + int lpadding = cols - 11; + wpprintw("%*s%-10s ", lpadding, "", cmd); break; case HOME_KEY: @@ -1229,7 +1233,6 @@ int main(int argc, char **argv) memset(&cmd, 0, MAX_COMMAND_SIZE); } else { move_xy(ARROW_DOWN); - wpprintw("%d", DELETE); } break; }