0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

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)
This commit is contained in:
Bram Moolenaar
2018-02-10 18:45:26 +01:00
parent 42443c7d7f
commit d23a823669
54 changed files with 233 additions and 465 deletions

View File

@@ -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;
}