diff options
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 06054b53ec..bd61925b0d 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -19811,16 +19811,15 @@ void ex_echo(exarg_T *eap) { char_u *arg = eap->arg; typval_T rettv; - bool needclr = true; bool atstart = true; const int did_emsg_before = did_emsg; if (eap->skip) ++emsg_skip; while (*arg != NUL && *arg != '|' && *arg != '\n' && !got_int) { - /* If eval1() causes an error message the text from the command may - * still need to be cleared. E.g., "echo 22,44". */ - need_clr_eos = needclr; + // If eval1() causes an error message the text from the command may + // still need to be cleared. E.g., "echo 22,44". + need_clr_eos = true; { char_u *p = arg; @@ -19864,14 +19863,14 @@ void ex_echo(exarg_T *eap) } eap->nextcmd = check_nextcmd(arg); - if (eap->skip) - --emsg_skip; - else { - /* remove text that may still be there from the command */ - if (needclr) - msg_clr_eos(); - if (eap->cmdidx == CMD_echo) + if (eap->skip) { + emsg_skip--; + } else { + // remove text that may still be there from the command + msg_clr_eos(); + if (eap->cmdidx == CMD_echo) { msg_end(); + } } } |