aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/syntax.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-07-09 06:58:27 -0400
committerGitHub <noreply@github.com>2016-07-09 06:58:27 -0400
commitadaacdd71a70b76bc686113eaece47a6264701a5 (patch)
tree4be6079a8571316cbd89e3f310981b080f2815a4 /src/nvim/syntax.c
parent6cee9d1a17177f4ccdf34283c6ed3ffaa98b32cc (diff)
parent059e9785dc2fea0a15344162de4a5a7c8da6f491 (diff)
downloadrneovim-adaacdd71a70b76bc686113eaece47a6264701a5.tar.gz
rneovim-adaacdd71a70b76bc686113eaece47a6264701a5.tar.bz2
rneovim-adaacdd71a70b76bc686113eaece47a6264701a5.zip
Merge #4648 from jamessan/packages
packages (vim-patch:7.4.{1384,1388,1396,1478,1479,1480,1486,1492,1499,1528,1550,1551,1552,1553,1554,1596,1649,1712,1840,1973,1986})
Diffstat (limited to 'src/nvim/syntax.c')
-rw-r--r--src/nvim/syntax.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index 05141eaf1e..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, TRUE) == 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;
- (void)source_runtime((char_u *)"syntax/syncolor.vim", TRUE);
- --recursive;
+ } else {
+ recursive++;
+ (void)source_runtime((char_u *)"syntax/syncolor.vim", DIP_ALL);
+ 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);
- retval = source_runtime(buf, FALSE);
+ 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;