Mercurial > vim
diff src/edit.c @ 13244:ac42c4b11dbc v8.0.1496
patch 8.0.1496: clearing a pointer takes two lines
commit https://github.com/vim/vim/commit/d23a823669d93fb2a570a039173eefe4856ac806
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Feb 10 18:45:26 2018 +0100
patch 8.0.1496: clearing a pointer takes two lines
Problem: Clearing a pointer takes two lines.
Solution: Add VIM_CLEAR() and replace vim_clear(). (Hirohito Higashi,
closes #2629)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 10 Feb 2018 19:00:07 +0100 |
parents | 5ed6e4a25925 |
children | 69517d67421f |
line wrap: on
line diff
--- a/src/edit.c +++ b/src/edit.c @@ -2939,7 +2939,7 @@ ins_compl_del_pum(void) if (compl_match_array != NULL) { pum_undisplay(); - vim_clear((void **)&compl_match_array); + VIM_CLEAR(compl_match_array); } } @@ -3441,8 +3441,8 @@ ins_compl_free(void) compl_T *match; int i; - vim_clear((void **)&compl_pattern); - vim_clear((void **)&compl_leader); + VIM_CLEAR(compl_pattern); + VIM_CLEAR(compl_leader); if (compl_first_match == NULL) return; @@ -3474,10 +3474,10 @@ ins_compl_clear(void) compl_cont_status = 0; compl_started = FALSE; compl_matches = 0; - vim_clear((void **)&compl_pattern); - vim_clear((void **)&compl_leader); + VIM_CLEAR(compl_pattern); + VIM_CLEAR(compl_leader); edit_submode_extra = NULL; - vim_clear((void **)&compl_orig_text); + VIM_CLEAR(compl_orig_text); compl_enter_selects = FALSE; /* clear v:completed_item */ set_vim_var_dict(VV_COMPLETED_ITEM, dict_alloc_lock(VAR_FIXED)); @@ -5584,8 +5584,8 @@ ins_complete(int c, int enable_pum) if (compl_orig_text == NULL || ins_compl_add(compl_orig_text, -1, p_ic, NULL, NULL, 0, ORIGINAL_TEXT, FALSE) != OK) { - vim_clear((void **)&compl_pattern); - vim_clear((void **)&compl_orig_text); + VIM_CLEAR(compl_pattern); + VIM_CLEAR(compl_orig_text); return FAIL; } @@ -7214,9 +7214,9 @@ set_last_insert(int c) void free_last_insert(void) { - vim_clear((void **)&last_insert); + VIM_CLEAR(last_insert); # ifdef FEAT_INS_EXPAND - vim_clear((void **)&compl_orig_text); + VIM_CLEAR(compl_orig_text); # endif } #endif @@ -7844,7 +7844,7 @@ mb_replace_pop_ins(int cc) static void replace_flush(void) { - vim_clear((void **)&replace_stack); + VIM_CLEAR(replace_stack); replace_stack_len = 0; replace_stack_nr = 0; }