aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/edit.c15
-rw-r--r--src/nvim/ex_cmds.c2
-rw-r--r--src/nvim/if_cscope.c2
-rw-r--r--src/nvim/memline.c5
-rw-r--r--src/nvim/message.c2
-rw-r--r--src/nvim/search.c2
-rw-r--r--src/nvim/syntax.c2
-rw-r--r--src/nvim/window.c2
8 files changed, 17 insertions, 15 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index 5fbe2c2eb6..a8dd115074 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -2586,15 +2586,16 @@ void ins_compl_show_pum(void)
// Need to build the popup menu list.
compl_match_arraysize = 0;
compl = compl_first_match;
- /*
- * If it's user complete function and refresh_always,
- * not use "compl_leader" as prefix filter.
- */
- if (ins_compl_need_restart()){
+ //
+ // If it's user complete function and refresh_always,
+ // do not use "compl_leader" as prefix filter.
+ //
+ if (ins_compl_need_restart()) {
XFREE_CLEAR(compl_leader);
}
- if (compl_leader != NULL)
+ if (compl_leader != NULL) {
lead_len = (int)STRLEN(compl_leader);
+ }
do {
if ((compl->cp_flags & ORIGINAL_TEXT) == 0
&& (compl_leader == NULL
@@ -2993,7 +2994,7 @@ static void ins_compl_clear(void)
XFREE_CLEAR(compl_leader);
edit_submode_extra = NULL;
XFREE_CLEAR(compl_orig_text);
- compl_enter_selects = FALSE;
+ compl_enter_selects = false;
// clear v:completed_item
set_vim_var_dict(VV_COMPLETED_ITEM, tv_dict_alloc());
}
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 180ebaf769..e7f4736613 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -4058,7 +4058,7 @@ skip:
}
if (did_sub) {
- ++sub_nlines;
+ sub_nlines++;
}
xfree(new_start); // for when substitute was cancelled
XFREE_CLEAR(sub_firstline); // free the copy of the original line
diff --git a/src/nvim/if_cscope.c b/src/nvim/if_cscope.c
index 2423fdcdae..4cb0c9a4ae 100644
--- a/src/nvim/if_cscope.c
+++ b/src/nvim/if_cscope.c
@@ -1530,7 +1530,7 @@ static void cs_fill_results(char *tagstr, size_t totmatches, int *nummatches_a,
} /* for all cscope connections */
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(cntxts);
}
diff --git a/src/nvim/memline.c b/src/nvim/memline.c
index c0a47054cc..a4d2feb5e3 100644
--- a/src/nvim/memline.c
+++ b/src/nvim/memline.c
@@ -3340,9 +3340,10 @@ static char *findswapname(buf_T *buf, char **dirp, char *old_fname,
(char_u *)dir_name);
for (;; ) {
- if (fname == NULL) /* must be out of memory */
+ if (fname == NULL) { // must be out of memory
break;
- if ((n = strlen(fname)) == 0) { /* safety check */
+ }
+ if ((n = strlen(fname)) == 0) { // safety check
XFREE_CLEAR(fname);
break;
}
diff --git a/src/nvim/message.c b/src/nvim/message.c
index 20f63773fe..077c28eb2c 100644
--- a/src/nvim/message.c
+++ b/src/nvim/message.c
@@ -2997,7 +2997,7 @@ void give_warning(char_u *message, bool hl) FUNC_ATTR_NONNULL_ARG(1)
/* Don't want a hit-enter prompt here. */
++no_wait_return;
- set_vim_var_string(VV_WARNINGMSG, (char *) message, -1);
+ set_vim_var_string(VV_WARNINGMSG, (char *)message, -1);
XFREE_CLEAR(keep_msg);
if (hl) {
keep_msg_attr = HL_ATTR(HLF_W);
diff --git a/src/nvim/search.c b/src/nvim/search.c
index 605d9383a7..3bd222b3de 100644
--- a/src/nvim/search.c
+++ b/src/nvim/search.c
@@ -4291,7 +4291,7 @@ find_pattern_in_path(
}
}
XFREE_CLEAR(new_fname);
- already_searched = TRUE;
+ already_searched = true;
break;
}
}
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index 461316e63d..4460c13ac6 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -5158,7 +5158,7 @@ static void syn_cmd_sync(exarg_T *eap, int syncing)
if (curwin->w_s->b_syn_linecont_prog == NULL) {
XFREE_CLEAR(curwin->w_s->b_syn_linecont_pat);
- finished = TRUE;
+ finished = true;
break;
}
}
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 3f555b9b2e..2ce3b7067b 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -4297,7 +4297,7 @@ static void win_enter_ext(win_T *wp, bool undo_sync, int curwin_invalid,
}
}
XFREE_CLEAR(globaldir);
- shorten_fnames(TRUE);
+ shorten_fnames(true);
}
if (trigger_new_autocmds) {