diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-05-22 01:02:26 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-05-25 10:07:05 +0200 |
commit | ae846b41dfed16446be6469cb01f12f1eb1fa534 (patch) | |
tree | 2851845f2faf61d5945cb4f1d8761316201a6246 /src/nvim/message.c | |
parent | a9d7ec4587d8eb20f12ebecc427ad818fb0e4971 (diff) | |
download | rneovim-ae846b41dfed16446be6469cb01f12f1eb1fa534.tar.gz rneovim-ae846b41dfed16446be6469cb01f12f1eb1fa534.tar.bz2 rneovim-ae846b41dfed16446be6469cb01f12f1eb1fa534.zip |
vim-patch:8.0.1496: VIM_CLEAR()
Problem: Clearing a pointer takes two lines.
Solution: Add VIM_CLEAR() and replace vim_clear(). (Hirohito Higashi,
closes #2629)
vim-patch:8.0.1481
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 { |