diff options
Diffstat (limited to 'src/nvim/message.c')
-rw-r--r-- | src/nvim/message.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/nvim/message.c b/src/nvim/message.c index cb83d6482c..20f63773fe 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -420,8 +420,7 @@ static char_u *last_sourcing_name = NULL; */ void reset_last_sourcing(void) { - xfree(last_sourcing_name); - last_sourcing_name = NULL; + XFREE_CLEAR(last_sourcing_name); last_sourcing_lnum = 0; } @@ -1117,8 +1116,7 @@ void wait_return(int redraw) reset_last_sourcing(); if (keep_msg != NULL && vim_strsize(keep_msg) >= (Rows - cmdline_row - 1) * Columns + sc_col) { - xfree(keep_msg); - keep_msg = NULL; /* don't redisplay message, it's too long */ + XFREE_CLEAR(keep_msg); // don't redisplay message, it's too long } if (tmpState == SETWSIZE) { /* got resize event while in vgetc() */ @@ -1188,8 +1186,7 @@ void msg_start(void) int did_return = FALSE; if (!msg_silent) { - xfree(keep_msg); - keep_msg = NULL; /* don't display old message now */ + XFREE_CLEAR(keep_msg); // don't display old message now } if (need_clr_eos) { @@ -3001,8 +2998,7 @@ void give_warning(char_u *message, bool hl) FUNC_ATTR_NONNULL_ARG(1) ++no_wait_return; set_vim_var_string(VV_WARNINGMSG, (char *) message, -1); - xfree(keep_msg); - keep_msg = NULL; + XFREE_CLEAR(keep_msg); if (hl) { keep_msg_attr = HL_ATTR(HLF_W); } else { |