aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-05-06 10:02:00 +0200
committerJustin M. Keyes <justinkz@gmail.com>2019-05-06 10:02:00 +0200
commitfe299a82a683c43d2734268a22b3e97acf8be0c7 (patch)
treef25ebfe453cbe8817d5887686cf932039bc5e81b /src
parenta52e93dfd84aac561ac05e74ce2193e6f396cc07 (diff)
downloadrneovim-fe299a82a683c43d2734268a22b3e97acf8be0c7.tar.gz
rneovim-fe299a82a683c43d2734268a22b3e97acf8be0c7.tar.bz2
rneovim-fe299a82a683c43d2734268a22b3e97acf8be0c7.zip
PVS/V547: Expression is always true
Since 67bac681ea6b (see msg_multiline_attr()) msg_clr_eos() is always called.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/eval.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 06054b53ec..2a033240a1 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;
@@ -19867,11 +19866,11 @@ void ex_echo(exarg_T *eap)
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)
+ // remove text that may still be there from the command
+ msg_clr_eos();
+ if (eap->cmdidx == CMD_echo) {
msg_end();
+ }
}
}