aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/syntax.c
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2016-07-08 01:36:23 -0400
committerJames McCoy <jamessan@jamessan.com>2016-07-08 01:45:21 -0400
commit059e9785dc2fea0a15344162de4a5a7c8da6f491 (patch)
tree4be6079a8571316cbd89e3f310981b080f2815a4 /src/nvim/syntax.c
parent86b4f6856b52b311137467af9a631f7e567dcfbf (diff)
downloadrneovim-059e9785dc2fea0a15344162de4a5a7c8da6f491.tar.gz
rneovim-059e9785dc2fea0a15344162de4a5a7c8da6f491.tar.bz2
rneovim-059e9785dc2fea0a15344162de4a5a7c8da6f491.zip
lint
Diffstat (limited to 'src/nvim/syntax.c')
-rw-r--r--src/nvim/syntax.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index 8792e80bcf..27855184df 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -4207,9 +4207,10 @@ static void syn_cmd_include(exarg_T *eap, int syncing)
current_syn_inc_tag = ++running_syn_inc_tag;
prev_toplvl_grp = curwin->w_s->b_syn_topgrp;
curwin->w_s->b_syn_topgrp = sgl_id;
- if (source ? do_source(eap->arg, FALSE, DOSO_NONE) == FAIL
- : source_runtime(eap->arg, DIP_ALL) == FAIL)
+ if (source ? do_source(eap->arg, false, DOSO_NONE) == FAIL
+ : source_runtime(eap->arg, DIP_ALL) == FAIL) {
EMSG2(_(e_notopen), eap->arg);
+ }
curwin->w_s->b_syn_topgrp = prev_toplvl_grp;
current_syn_inc_tag = prev_syn_inc_tag;
}
@@ -6023,12 +6024,12 @@ init_highlight (
if (get_var_value((char_u *)"g:syntax_on") != NULL) {
static int recursive = 0;
- if (recursive >= 5)
+ if (recursive >= 5) {
EMSG(_("E679: recursive loop loading syncolor.vim"));
- else {
- ++recursive;
+ } else {
+ recursive++;
(void)source_runtime((char_u *)"syntax/syncolor.vim", DIP_ALL);
- --recursive;
+ recursive--;
}
}
}
@@ -6041,22 +6042,24 @@ int load_colors(char_u *name)
{
char_u *buf;
int retval = FAIL;
- static int recursive = FALSE;
+ static int recursive = false;
- /* When being called recursively, this is probably because setting
- * 'background' caused the highlighting to be reloaded. This means it is
- * working, thus we should return OK. */
- if (recursive)
+ // When being called recursively, this is probably because setting
+ // 'background' caused the highlighting to be reloaded. This means it is
+ // working, thus we should return OK.
+ if (recursive) {
return OK;
+ }
- recursive = TRUE;
- buf = xmalloc(STRLEN(name) + 12);
- sprintf((char *)buf, "colors/%s.vim", name);
+ recursive = true;
+ size_t buflen = STRLEN(name) + 12;
+ buf = xmalloc(buflen);
+ snprintf((char *)buf, buflen, "colors/%s.vim", name);
retval = source_runtime(buf, DIP_START + DIP_OPT);
xfree(buf);
apply_autocmds(EVENT_COLORSCHEME, name, curbuf->b_fname, FALSE, curbuf);
- recursive = FALSE;
+ recursive = false;
ui_refresh();
return retval;