This commit is contained in:
Justin M. Keyes
2019-05-25 11:13:18 +02:00
parent c4f56c4134
commit 51a59a0f62
8 changed files with 17 additions and 15 deletions

View File

@@ -2586,15 +2586,16 @@ void ins_compl_show_pum(void)
// Need to build the popup menu list. // Need to build the popup menu list.
compl_match_arraysize = 0; compl_match_arraysize = 0;
compl = compl_first_match; compl = compl_first_match;
/* //
* If it's user complete function and refresh_always, // If it's user complete function and refresh_always,
* not use "compl_leader" as prefix filter. // do not use "compl_leader" as prefix filter.
*/ //
if (ins_compl_need_restart()) { if (ins_compl_need_restart()) {
XFREE_CLEAR(compl_leader); XFREE_CLEAR(compl_leader);
} }
if (compl_leader != NULL) if (compl_leader != NULL) {
lead_len = (int)STRLEN(compl_leader); lead_len = (int)STRLEN(compl_leader);
}
do { do {
if ((compl->cp_flags & ORIGINAL_TEXT) == 0 if ((compl->cp_flags & ORIGINAL_TEXT) == 0
&& (compl_leader == NULL && (compl_leader == NULL
@@ -2993,7 +2994,7 @@ static void ins_compl_clear(void)
XFREE_CLEAR(compl_leader); XFREE_CLEAR(compl_leader);
edit_submode_extra = NULL; edit_submode_extra = NULL;
XFREE_CLEAR(compl_orig_text); XFREE_CLEAR(compl_orig_text);
compl_enter_selects = FALSE; compl_enter_selects = false;
// clear v:completed_item // clear v:completed_item
set_vim_var_dict(VV_COMPLETED_ITEM, tv_dict_alloc()); set_vim_var_dict(VV_COMPLETED_ITEM, tv_dict_alloc());
} }

View File

@@ -4058,7 +4058,7 @@ skip:
} }
if (did_sub) { if (did_sub) {
++sub_nlines; sub_nlines++;
} }
xfree(new_start); // for when substitute was cancelled xfree(new_start); // for when substitute was cancelled
XFREE_CLEAR(sub_firstline); // free the copy of the original line XFREE_CLEAR(sub_firstline); // free the copy of the original line

View File

@@ -1530,7 +1530,7 @@ static void cs_fill_results(char *tagstr, size_t totmatches, int *nummatches_a,
} /* for all cscope connections */ } /* for all cscope connections */
if (totsofar == 0) { if (totsofar == 0) {
/* No matches, free the arrays and return NULL in "*matches_p". */ // No matches, free the arrays and return NULL in "*matches_p".
XFREE_CLEAR(matches); XFREE_CLEAR(matches);
XFREE_CLEAR(cntxts); XFREE_CLEAR(cntxts);
} }

View File

@@ -3340,9 +3340,10 @@ static char *findswapname(buf_T *buf, char **dirp, char *old_fname,
(char_u *)dir_name); (char_u *)dir_name);
for (;; ) { for (;; ) {
if (fname == NULL) /* must be out of memory */ if (fname == NULL) { // must be out of memory
break; break;
if ((n = strlen(fname)) == 0) { /* safety check */ }
if ((n = strlen(fname)) == 0) { // safety check
XFREE_CLEAR(fname); XFREE_CLEAR(fname);
break; break;
} }

View File

@@ -4291,7 +4291,7 @@ find_pattern_in_path(
} }
} }
XFREE_CLEAR(new_fname); XFREE_CLEAR(new_fname);
already_searched = TRUE; already_searched = true;
break; break;
} }
} }

View File

@@ -5158,7 +5158,7 @@ static void syn_cmd_sync(exarg_T *eap, int syncing)
if (curwin->w_s->b_syn_linecont_prog == NULL) { if (curwin->w_s->b_syn_linecont_prog == NULL) {
XFREE_CLEAR(curwin->w_s->b_syn_linecont_pat); XFREE_CLEAR(curwin->w_s->b_syn_linecont_pat);
finished = TRUE; finished = true;
break; break;
} }
} }

View File

@@ -4297,7 +4297,7 @@ static void win_enter_ext(win_T *wp, bool undo_sync, int curwin_invalid,
} }
} }
XFREE_CLEAR(globaldir); XFREE_CLEAR(globaldir);
shorten_fnames(TRUE); shorten_fnames(true);
} }
if (trigger_new_autocmds) { if (trigger_new_autocmds) {