aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/syntax.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/syntax.c')
-rw-r--r--src/nvim/syntax.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index baf5d4784d..ce19320331 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -3286,17 +3286,23 @@ static void syn_cmd_off(exarg_T *eap, int syncing)
}
static void syn_cmd_onoff(exarg_T *eap, char *name)
+ FUNC_ATTR_NONNULL_ALL
{
- char buf[100];
-
eap->nextcmd = check_nextcmd(eap->arg);
if (!eap->skip) {
- strcpy(buf, "so ");
- vim_snprintf(buf + 3, sizeof(buf) - 3, SYNTAX_FNAME, name);
- do_cmdline_cmd(buf);
+ 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);
+ do_cmdline_cmd(buf);
+}
+
/*
* Handle ":syntax [list]" command: list current syntax words.
*/