mirror of
https://github.com/neovim/neovim.git
synced 2025-09-17 00:38:17 +00:00
syntax: avoid extra global macro
This commit is contained in:
@@ -92,10 +92,6 @@
|
|||||||
# define SYNTAX_FNAME "$VIMRUNTIME" _PATHSEPSTR "syntax" _PATHSEPSTR "%s.vim"
|
# define SYNTAX_FNAME "$VIMRUNTIME" _PATHSEPSTR "syntax" _PATHSEPSTR "%s.vim"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SYNTAX_FILE
|
|
||||||
# define SYNTAX_FILE "$VIMRUNTIME" _PATHSEPSTR "syntax" _PATHSEPSTR "syntax.vim"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef EXRC_FILE
|
#ifndef EXRC_FILE
|
||||||
# define EXRC_FILE ".exrc"
|
# define EXRC_FILE ".exrc"
|
||||||
#endif
|
#endif
|
||||||
|
@@ -337,7 +337,7 @@ int main(int argc, char **argv)
|
|||||||
// Do this before syntax/syntax.vim (which calls `:filetype on`).
|
// Do this before syntax/syntax.vim (which calls `:filetype on`).
|
||||||
force_enable_filetype();
|
force_enable_filetype();
|
||||||
// Enable syntax highlighting.
|
// Enable syntax highlighting.
|
||||||
do_source((char_u *)SYNTAX_FILE, false, DOSO_NONE);
|
syn_cmd("syntax"); // sources syntax/syntax.vim
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -3286,15 +3286,21 @@ static void syn_cmd_off(exarg_T *eap, int syncing)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void syn_cmd_onoff(exarg_T *eap, char *name)
|
static void syn_cmd_onoff(exarg_T *eap, char *name)
|
||||||
|
FUNC_ATTR_NONNULL_ALL
|
||||||
{
|
{
|
||||||
char buf[100];
|
|
||||||
|
|
||||||
eap->nextcmd = check_nextcmd(eap->arg);
|
eap->nextcmd = check_nextcmd(eap->arg);
|
||||||
if (!eap->skip) {
|
if (!eap->skip) {
|
||||||
strcpy(buf, "so ");
|
syn_cmd(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void syn_cmd(char *name)
|
||||||
|
FUNC_ATTR_NONNULL_ALL
|
||||||
|
{
|
||||||
|
char buf[100];
|
||||||
|
strncpy(buf, "so ", 3);
|
||||||
vim_snprintf(buf + 3, sizeof(buf) - 3, SYNTAX_FNAME, name);
|
vim_snprintf(buf + 3, sizeof(buf) - 3, SYNTAX_FNAME, name);
|
||||||
do_cmdline_cmd(buf);
|
do_cmdline_cmd(buf);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user