This commit is contained in:
James McCoy
2016-07-08 01:36:23 -04:00
parent 86b4f6856b
commit 059e9785dc
11 changed files with 173 additions and 167 deletions

View File

@@ -20498,9 +20498,10 @@ script_autoload (
tofree = NULL;
}
/* Try loading the package from $VIMRUNTIME/autoload/<name>.vim */
if (source_runtime(scriptname, 0) == OK)
ret = TRUE;
// Try loading the package from $VIMRUNTIME/autoload/<name>.vim
if (source_runtime(scriptname, 0) == OK) {
ret = true;
}
}
xfree(tofree);

View File

@@ -4797,13 +4797,14 @@ void ex_viusage(exarg_T *eap)
/// Generate tags in one help directory
static void
helptags_one (
char_u *dir, /* doc directory */
char_u *ext, /* suffix, ".txt", ".itx", ".frx", etc. */
char_u *tagfname, /* "tags" for English, "tags-fr" for French. */
int add_help_tags /* add "help-tags" tag */
)
///
/// @param dir Path to the doc directory
/// @param ext Suffix of the help files (".txt", ".itx", ".frx", etc.)
/// @param tagname Name of the tags file ("tags" for English, "tags-fr" for
/// French)
/// @param add_help_tags Whether to add the "help-tags" tag
static void helptags_one(char_u *dir, char_u *ext, char_u *tagfname,
bool add_help_tags)
{
FILE *fd_tags;
FILE *fd;
@@ -5004,7 +5005,7 @@ helptags_one (
}
/// Generate tags in one help directory, taking care of translations.
static void do_helptags(char_u *dirname, int add_help_tags)
static void do_helptags(char_u *dirname, bool add_help_tags)
{
int len;
garray_T ga;
@@ -5034,8 +5035,7 @@ static void do_helptags(char_u *dirname, int add_help_tags)
* present. */
int j;
ga_init(&ga, 1, 10);
for (int i = 0; i < filecount; ++i)
{
for (int i = 0; i < filecount; i++) {
len = (int)STRLEN(files[i]);
if (len <= 4) {
continue;
@@ -5054,13 +5054,14 @@ static void do_helptags(char_u *dirname, int add_help_tags)
} else
continue;
/* Did we find this language already? */
for (j = 0; j < ga.ga_len; j += 2)
if (STRNCMP(lang, ((char_u *)ga.ga_data) + j, 2) == 0)
// Did we find this language already?
for (j = 0; j < ga.ga_len; j += 2) {
if (STRNCMP(lang, ((char_u *)ga.ga_data) + j, 2) == 0) {
break;
if (j == ga.ga_len)
{
/* New language, add it. */
}
}
if (j == ga.ga_len) {
// New language, add it.
ga_grow(&ga, 2);
((char_u *)ga.ga_data)[ga.ga_len++] = lang[0];
((char_u *)ga.ga_data)[ga.ga_len++] = lang[1];

View File

@@ -2329,7 +2329,7 @@ int do_in_path(char_u *path, char_u *name, int flags,
if (p_verbose > 1 && name != NULL) {
verbose_enter();
smsg(_("Searching for \"%s\" in \"%s\""),
(char *)name, (char *)path);
(char *)name, (char *)path);
verbose_leave();
}
@@ -2365,7 +2365,7 @@ int do_in_path(char_u *path, char_u *name, int flags,
if (gen_expand_wildcards(1, &buf, &num_files, &files,
(flags & DIP_DIR) ? EW_DIR
: EW_FILE) == OK) {
for (i = 0; i < num_files; ++i) {
for (i = 0; i < num_files; i++) {
(*callback)(files[i], cookie);
did_one = true;
if (!(flags & DIP_ALL)) {
@@ -2414,7 +2414,7 @@ int do_in_runtimepath(char_u *name, int flags, DoInRuntimepathCB callback,
}
if ((done == FAIL || (flags & DIP_ALL)) && (flags & DIP_START)) {
char *start_dir = "pack/*/start/*/%s";
char *start_dir = "pack/*/start/*/%s"; // NOLINT
size_t len = STRLEN(start_dir) + STRLEN(name);
char_u *s = xmallocz(len);
@@ -2425,7 +2425,7 @@ int do_in_runtimepath(char_u *name, int flags, DoInRuntimepathCB callback,
}
if ((done == FAIL || (flags & DIP_ALL)) && (flags & DIP_OPT)) {
char *opt_dir = "pack/*/opt/*/%s";
char *opt_dir = "pack/*/opt/*/%s"; // NOLINT
size_t len = STRLEN(opt_dir) + STRLEN(name);
char_u *s = xmallocz(len);
@@ -2541,8 +2541,8 @@ static void add_pack_plugin(char_u *fname, void *cookie)
}
if (cookie != &APP_ADD_DIR) {
static const char *plugpat = "%s/plugin/*.vim";
static const char *ftpat = "%s/ftdetect/*.vim";
static const char *plugpat = "%s/plugin/*.vim"; // NOLINT
static const char *ftpat = "%s/ftdetect/*.vim"; // NOLINT
size_t len = STRLEN(ffname) + STRLEN(ftpat);
char_u *pat = try_malloc(len + 1);
@@ -2582,9 +2582,9 @@ void ex_packloadall(exarg_T *eap)
// First do a round to add all directories to 'runtimepath', then load
// the plugins. This allows for plugins to use an autoload directory
// of another plugin.
do_in_path(p_pp, (char_u *)"pack/*/start/*", DIP_ALL + DIP_DIR,
do_in_path(p_pp, (char_u *)"pack/*/start/*", DIP_ALL + DIP_DIR, // NOLINT
add_pack_plugin, &APP_ADD_DIR);
do_in_path(p_pp, (char_u *)"pack/*/start/*", DIP_ALL + DIP_DIR,
do_in_path(p_pp, (char_u *)"pack/*/start/*", DIP_ALL + DIP_DIR, // NOLINT
add_pack_plugin, &APP_LOAD);
}
}
@@ -2592,7 +2592,7 @@ void ex_packloadall(exarg_T *eap)
/// ":packadd[!] {name}"
void ex_packadd(exarg_T *eap)
{
static const char *plugpat = "pack/*/opt/%s";
static const char *plugpat = "pack/*/opt/%s"; // NOLINT
size_t len = STRLEN(plugpat) + STRLEN(eap->arg);
char *pat = (char *)xmallocz(len);

View File

@@ -4665,42 +4665,42 @@ static struct {
char *name;
} command_complete[] =
{
{EXPAND_AUGROUP, "augroup"},
{EXPAND_BEHAVE, "behave"},
{EXPAND_BUFFERS, "buffer"},
{EXPAND_COLORS, "color"},
{EXPAND_COMMANDS, "command"},
{EXPAND_COMPILER, "compiler"},
{EXPAND_CSCOPE, "cscope"},
{EXPAND_USER_DEFINED, "custom"},
{EXPAND_USER_LIST, "customlist"},
{EXPAND_DIRECTORIES, "dir"},
{EXPAND_ENV_VARS, "environment"},
{EXPAND_EVENTS, "event"},
{EXPAND_EXPRESSION, "expression"},
{EXPAND_FILES, "file"},
{EXPAND_FILES_IN_PATH, "file_in_path"},
{EXPAND_FILETYPE, "filetype"},
{EXPAND_FUNCTIONS, "function"},
{EXPAND_HELP, "help"},
{EXPAND_HIGHLIGHT, "highlight"},
{EXPAND_HISTORY, "history"},
{ EXPAND_AUGROUP, "augroup" },
{ EXPAND_BEHAVE, "behave" },
{ EXPAND_BUFFERS, "buffer" },
{ EXPAND_COLORS, "color" },
{ EXPAND_COMMANDS, "command" },
{ EXPAND_COMPILER, "compiler" },
{ EXPAND_CSCOPE, "cscope" },
{ EXPAND_USER_DEFINED, "custom" },
{ EXPAND_USER_LIST, "customlist" },
{ EXPAND_DIRECTORIES, "dir" },
{ EXPAND_ENV_VARS, "environment" },
{ EXPAND_EVENTS, "event" },
{ EXPAND_EXPRESSION, "expression" },
{ EXPAND_FILES, "file" },
{ EXPAND_FILES_IN_PATH, "file_in_path" },
{ EXPAND_FILETYPE, "filetype" },
{ EXPAND_FUNCTIONS, "function" },
{ EXPAND_HELP, "help" },
{ EXPAND_HIGHLIGHT, "highlight" },
{ EXPAND_HISTORY, "history" },
#ifdef HAVE_WORKING_LIBINTL
{EXPAND_LOCALES, "locale"},
{ EXPAND_LOCALES, "locale" },
#endif
{EXPAND_MAPPINGS, "mapping"},
{EXPAND_MENUS, "menu"},
{EXPAND_OWNSYNTAX, "syntax"},
{EXPAND_SYNTIME, "syntime"},
{EXPAND_SETTINGS, "option"},
{EXPAND_PACKADD, "packadd"},
{EXPAND_SHELLCMD, "shellcmd"},
{EXPAND_SIGN, "sign"},
{EXPAND_TAGS, "tag"},
{EXPAND_TAGS_LISTFILES, "tag_listfiles"},
{EXPAND_USER, "user"},
{EXPAND_USER_VARS, "var"},
{0, NULL}
{ EXPAND_MAPPINGS, "mapping" },
{ EXPAND_MENUS, "menu" },
{ EXPAND_OWNSYNTAX, "syntax" },
{ EXPAND_SYNTIME, "syntime" },
{ EXPAND_SETTINGS, "option" },
{ EXPAND_PACKADD, "packadd" },
{ EXPAND_SHELLCMD, "shellcmd" },
{ EXPAND_SIGN, "sign" },
{ EXPAND_TAGS, "tag" },
{ EXPAND_TAGS_LISTFILES, "tag_listfiles" },
{ EXPAND_USER, "user" },
{ EXPAND_USER_VARS, "var" },
{ 0, NULL }
};
static void uc_list(char_u *name, size_t name_len)

View File

@@ -3795,19 +3795,19 @@ ExpandFromContext (
|| xp->xp_context == EXPAND_TAGS_LISTFILES)
return expand_tags(xp->xp_context == EXPAND_TAGS, pat, num_file, file);
if (xp->xp_context == EXPAND_COLORS) {
char *directories[] = {"colors", NULL};
char *directories[] = { "colors", NULL };
return ExpandRTDir(pat, DIP_START + DIP_OPT, num_file, file, directories);
}
if (xp->xp_context == EXPAND_COMPILER) {
char *directories[] = {"compiler", NULL};
char *directories[] = { "compiler", NULL };
return ExpandRTDir(pat, 0, num_file, file, directories);
}
if (xp->xp_context == EXPAND_OWNSYNTAX) {
char *directories[] = {"syntax", NULL};
char *directories[] = { "syntax", NULL };
return ExpandRTDir(pat, 0, num_file, file, directories);
}
if (xp->xp_context == EXPAND_FILETYPE) {
char *directories[] = {"syntax", "indent", "ftplugin", NULL};
char *directories[] = { "syntax", "indent", "ftplugin", NULL };
return ExpandRTDir(pat, 0, num_file, file, directories);
}
if (xp->xp_context == EXPAND_USER_LIST) {
@@ -4225,7 +4225,7 @@ static int ExpandRTDir(char_u *pat, int flags, int *num_file, char_u ***file,
for (int i = 0; dirnames[i] != NULL; i++) {
size_t size = STRLEN(dirnames[i]) + pat_len + 22;
char_u *s = xmalloc(size);
snprintf((char *)s, size, "pack/*/start/*/%s/%s*.vim", dirnames[i], pat);
snprintf((char *)s, size, "pack/*/start/*/%s/%s*.vim", dirnames[i], pat); // NOLINT
globpath(p_pp, s, &ga, 0);
xfree(s);
}
@@ -4235,7 +4235,7 @@ static int ExpandRTDir(char_u *pat, int flags, int *num_file, char_u ***file,
for (int i = 0; dirnames[i] != NULL; i++) {
size_t size = STRLEN(dirnames[i]) + pat_len + 20;
char_u *s = xmalloc(size);
snprintf((char *)s, size, "pack/*/opt/*/%s/%s*.vim", dirnames[i], pat);
snprintf((char *)s, size, "pack/*/opt/*/%s/%s*.vim", dirnames[i], pat); // NOLINT
globpath(p_pp, s, &ga, 0);
xfree(s);
}
@@ -4281,12 +4281,13 @@ static int ExpandPackAddDir(char_u *pat, int *num_file, char_u ***file)
size_t pat_len = STRLEN(pat);
ga_init(&ga, (int)sizeof(char *), 10);
char_u *s = xmalloc((unsigned)(pat_len + 26));
sprintf((char *)s, "pack/*/opt/%s*", pat);
size_t buflen = pat_len + 26;
char_u *s = xmalloc(buflen);
snprintf((char *)s, buflen, "pack/*/opt/%s*", pat); // NOLINT
globpath(p_pp, s, &ga, 0);
xfree(s);
for (int i = 0; i < ga.ga_len; ++i) {
for (int i = 0; i < ga.ga_len; i++) {
char_u *match = ((char_u **)ga.ga_data)[i];
s = path_tail(match);
char_u *e = s + STRLEN(s);

View File

@@ -1223,7 +1223,8 @@ EXTERN char_u e_invalpat[] INIT(= N_(
EXTERN char_u e_bufloaded[] INIT(= N_("E139: File is loaded in another buffer"));
EXTERN char_u e_notset[] INIT(= N_("E764: Option '%s' is not set"));
EXTERN char_u e_invalidreg[] INIT(= N_("E850: Invalid register name"));
EXTERN char_u e_dirnotf[] INIT(= N_("E919: Directory not found in '%s': \"%s\""));
EXTERN char_u e_dirnotf[] INIT(= N_(
"E919: Directory not found in '%s': \"%s\""));
EXTERN char_u e_unsupportedoption[] INIT(= N_("E519: Option not supported"));

View File

@@ -1241,7 +1241,7 @@ static void set_window_layout(mparm_T *paramp)
static void load_plugins(void)
{
if (p_lpl) {
source_runtime((char_u *)"plugin/**/*.vim", DIP_ALL);
source_runtime((char_u *)"plugin/**/*.vim", DIP_ALL); // NOLINT
TIME_MSG("loading plugins");
ex_packloadall(NULL);

View File

@@ -3187,7 +3187,8 @@ did_set_string_option (
for (p = q; *p != NUL; ++p)
if (vim_strchr((char_u *)"_.,", *p) != NULL)
break;
vim_snprintf((char *)fname, 200, "spell/%.*s.vim", (int)(p - q), q);
vim_snprintf((char *)fname, sizeof(fname), "spell/%.*s.vim",
(int)(p - q), q);
source_runtime(fname, DIP_ALL);
}
}

View File

@@ -456,81 +456,81 @@ EXTERN int p_hid; // 'hidden'
// Use P_HID to check if a buffer is to be hidden when it is no longer
// visible in a window.
# define P_HID(buf) (buf_hide(buf))
EXTERN char_u *p_hl; /* 'highlight' */
EXTERN int p_hls; /* 'hlsearch' */
EXTERN long p_hi; /* 'history' */
EXTERN int p_hkmap; /* 'hkmap' */
EXTERN int p_hkmapp; /* 'hkmapp' */
EXTERN int p_fkmap; /* 'fkmap' */
EXTERN int p_altkeymap; /* 'altkeymap' */
EXTERN int p_arshape; /* 'arabicshape' */
EXTERN int p_icon; /* 'icon' */
EXTERN char_u *p_iconstring; /* 'iconstring' */
EXTERN int p_ic; /* 'ignorecase' */
EXTERN int p_is; /* 'incsearch' */
EXTERN int p_im; /* 'insertmode' */
EXTERN char_u *p_isf; /* 'isfname' */
EXTERN char_u *p_isi; /* 'isident' */
EXTERN char_u *p_isp; /* 'isprint' */
EXTERN int p_js; /* 'joinspaces' */
EXTERN char_u *p_kp; /* 'keywordprg' */
EXTERN char_u *p_km; /* 'keymodel' */
EXTERN char_u *p_langmap; /* 'langmap'*/
EXTERN int p_lnr; /* 'langnoremap'*/
EXTERN char_u *p_lm; /* 'langmenu' */
EXTERN char_u *p_lispwords; /* 'lispwords' */
EXTERN long p_ls; /* 'laststatus' */
EXTERN long p_stal; /* 'showtabline' */
EXTERN char_u *p_lcs; /* 'listchars' */
EXTERN char_u *p_hl; // 'highlight'
EXTERN int p_hls; // 'hlsearch'
EXTERN long p_hi; // 'history'
EXTERN int p_hkmap; // 'hkmap'
EXTERN int p_hkmapp; // 'hkmapp'
EXTERN int p_fkmap; // 'fkmap'
EXTERN int p_altkeymap; // 'altkeymap'
EXTERN int p_arshape; // 'arabicshape'
EXTERN int p_icon; // 'icon'
EXTERN char_u *p_iconstring; // 'iconstring'
EXTERN int p_ic; // 'ignorecase'
EXTERN int p_is; // 'incsearch'
EXTERN int p_im; // 'insertmode'
EXTERN char_u *p_isf; // 'isfname'
EXTERN char_u *p_isi; // 'isident'
EXTERN char_u *p_isp; // 'isprint'
EXTERN int p_js; // 'joinspaces'
EXTERN char_u *p_kp; // 'keywordprg'
EXTERN char_u *p_km; // 'keymodel'
EXTERN char_u *p_langmap; // 'langmap'*/
EXTERN int p_lnr; // 'langnoremap'*/
EXTERN char_u *p_lm; // 'langmenu'
EXTERN char_u *p_lispwords; // 'lispwords'
EXTERN long p_ls; // 'laststatus'
EXTERN long p_stal; // 'showtabline'
EXTERN char_u *p_lcs; // 'listchars'
EXTERN int p_lz; /* 'lazyredraw' */
EXTERN int p_lpl; /* 'loadplugins' */
EXTERN int p_magic; /* 'magic' */
EXTERN char_u *p_mef; /* 'makeef' */
EXTERN char_u *p_mp; /* 'makeprg' */
EXTERN char_u *p_cc; /* 'colorcolumn' */
EXTERN int p_cc_cols[256]; /* array for 'colorcolumn' columns */
EXTERN long p_mat; /* 'matchtime' */
EXTERN long p_mco; /* 'maxcombine' */
EXTERN long p_mfd; /* 'maxfuncdepth' */
EXTERN long p_mmd; /* 'maxmapdepth' */
EXTERN long p_mm; /* 'maxmem' */
EXTERN long p_mmp; /* 'maxmempattern' */
EXTERN long p_mmt; /* 'maxmemtot' */
EXTERN long p_mis; /* 'menuitems' */
EXTERN char_u *p_msm; /* 'mkspellmem' */
EXTERN long p_mls; /* 'modelines' */
EXTERN char_u *p_mouse; /* 'mouse' */
EXTERN char_u *p_mousem; /* 'mousemodel' */
EXTERN long p_mouset; /* 'mousetime' */
EXTERN int p_more; /* 'more' */
EXTERN char_u *p_opfunc; /* 'operatorfunc' */
EXTERN char_u *p_para; /* 'paragraphs' */
EXTERN int p_paste; /* 'paste' */
EXTERN char_u *p_pt; /* 'pastetoggle' */
EXTERN char_u *p_pex; /* 'patchexpr' */
EXTERN char_u *p_pm; /* 'patchmode' */
EXTERN char_u *p_path; /* 'path' */
EXTERN char_u *p_cdpath; /* 'cdpath' */
EXTERN long p_rdt; /* 'redrawtime' */
EXTERN int p_remap; /* 'remap' */
EXTERN long p_re; /* 'regexpengine' */
EXTERN long p_report; /* 'report' */
EXTERN long p_pvh; /* 'previewheight' */
EXTERN int p_ari; /* 'allowrevins' */
EXTERN int p_ri; /* 'revins' */
EXTERN int p_ru; /* 'ruler' */
EXTERN char_u *p_ruf; /* 'rulerformat' */
EXTERN char_u *p_pp; /* 'packpath' */
EXTERN char_u *p_rtp; /* 'runtimepath' */
EXTERN long p_sj; /* 'scrolljump' */
EXTERN long p_so; /* 'scrolloff' */
EXTERN char_u *p_sbo; /* 'scrollopt' */
EXTERN char_u *p_sections; /* 'sections' */
EXTERN int p_secure; /* 'secure' */
EXTERN char_u *p_sel; /* 'selection' */
EXTERN char_u *p_slm; /* 'selectmode' */
EXTERN char_u *p_ssop; /* 'sessionoptions' */
EXTERN int p_lz; // 'lazyredraw'
EXTERN int p_lpl; // 'loadplugins'
EXTERN int p_magic; // 'magic'
EXTERN char_u *p_mef; // 'makeef'
EXTERN char_u *p_mp; // 'makeprg'
EXTERN char_u *p_cc; // 'colorcolumn'
EXTERN int p_cc_cols[256]; // array for 'colorcolumn' columns
EXTERN long p_mat; // 'matchtime'
EXTERN long p_mco; // 'maxcombine'
EXTERN long p_mfd; // 'maxfuncdepth'
EXTERN long p_mmd; // 'maxmapdepth'
EXTERN long p_mm; // 'maxmem'
EXTERN long p_mmp; // 'maxmempattern'
EXTERN long p_mmt; // 'maxmemtot'
EXTERN long p_mis; // 'menuitems'
EXTERN char_u *p_msm; // 'mkspellmem'
EXTERN long p_mls; // 'modelines'
EXTERN char_u *p_mouse; // 'mouse'
EXTERN char_u *p_mousem; // 'mousemodel'
EXTERN long p_mouset; // 'mousetime'
EXTERN int p_more; // 'more'
EXTERN char_u *p_opfunc; // 'operatorfunc'
EXTERN char_u *p_para; // 'paragraphs'
EXTERN int p_paste; // 'paste'
EXTERN char_u *p_pt; // 'pastetoggle'
EXTERN char_u *p_pex; // 'patchexpr'
EXTERN char_u *p_pm; // 'patchmode'
EXTERN char_u *p_path; // 'path'
EXTERN char_u *p_cdpath; // 'cdpath'
EXTERN long p_rdt; // 'redrawtime'
EXTERN int p_remap; // 'remap'
EXTERN long p_re; // 'regexpengine'
EXTERN long p_report; // 'report'
EXTERN long p_pvh; // 'previewheight'
EXTERN int p_ari; // 'allowrevins'
EXTERN int p_ri; // 'revins'
EXTERN int p_ru; // 'ruler'
EXTERN char_u *p_ruf; // 'rulerformat'
EXTERN char_u *p_pp; // 'packpath'
EXTERN char_u *p_rtp; // 'runtimepath'
EXTERN long p_sj; // 'scrolljump'
EXTERN long p_so; // 'scrolloff'
EXTERN char_u *p_sbo; // 'scrollopt'
EXTERN char_u *p_sections; // 'sections'
EXTERN int p_secure; // 'secure'
EXTERN char_u *p_sel; // 'selection'
EXTERN char_u *p_slm; // 'selectmode'
EXTERN char_u *p_ssop; // 'sessionoptions'
EXTERN unsigned ssop_flags;
# ifdef IN_OPTION_C
/* Also used for 'viewoptions'! */

View File

@@ -2317,15 +2317,13 @@ static void spell_load_lang(char_u *lang)
for (round = 1; round <= 2; ++round) {
// Find the first spell file for "lang" in 'runtimepath' and load it.
vim_snprintf((char *)fname_enc, sizeof(fname_enc) - 5,
"spell/%s.%s.spl",
lang, spell_enc());
"spell/%s.%s.spl", lang, spell_enc());
r = do_in_runtimepath(fname_enc, 0, spell_load_cb, &sl);
if (r == FAIL && *sl.sl_lang != NUL) {
// Try loading the ASCII version.
vim_snprintf((char *)fname_enc, sizeof(fname_enc) - 5,
"spell/%s.ascii.spl",
lang);
"spell/%s.ascii.spl", lang);
r = do_in_runtimepath(fname_enc, 0, spell_load_cb, &sl);
if (r == FAIL && *sl.sl_lang != NUL && round == 1

View File

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