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.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index b63d2a729d..538863326c 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -15,6 +15,7 @@
#include "nvim/charset.h"
#include "nvim/cmdexpand_defs.h"
#include "nvim/drawscreen.h"
+#include "nvim/errors.h"
#include "nvim/eval.h"
#include "nvim/eval/typval_defs.h"
#include "nvim/eval/vars.h"
@@ -3185,7 +3186,7 @@ static void syn_cmd_onoff(exarg_T *eap, char *name)
if (!eap->skip) {
did_syntax_onoff = true;
char buf[100];
- memcpy(buf, "so ", 4);
+ memcpy(buf, S_LEN("so ") + 1);
vim_snprintf(buf + 3, sizeof(buf) - 3, SYNTAX_FNAME, name);
do_cmdline_cmd(buf);
}
@@ -4295,7 +4296,7 @@ static void syn_cmd_region(exarg_T *eap, int syncing)
if (item == ITEM_MATCHGROUP) {
char *p = skiptowhite(rest);
- if ((p - rest == 4 && strncmp(rest, "NONE", 4) == 0) || eap->skip) {
+ if ((p - rest == 4 && strncmp(rest, S_LEN("NONE")) == 0) || eap->skip) {
matchgroup_id = 0;
} else {
matchgroup_id = syn_check_group(rest, (size_t)(p - rest));
@@ -4814,10 +4815,10 @@ static void syn_cmd_sync(exarg_T *eap, int syncing)
} else if (!eap->skip) {
curwin->w_s->b_syn_sync_id = (int16_t)syn_name2id("Comment");
}
- } else if (strncmp(key, "LINES", 5) == 0
- || strncmp(key, "MINLINES", 8) == 0
- || strncmp(key, "MAXLINES", 8) == 0
- || strncmp(key, "LINEBREAKS", 10) == 0) {
+ } else if (strncmp(key, S_LEN("LINES")) == 0
+ || strncmp(key, S_LEN("MINLINES")) == 0
+ || strncmp(key, S_LEN("MAXLINES")) == 0
+ || strncmp(key, S_LEN("LINEBREAKS")) == 0) {
if (key[4] == 'S') {
arg_end = key + 6;
} else if (key[0] == 'L') {
@@ -4991,7 +4992,7 @@ static int get_id_list(char **const arg, const int keylen, int16_t **const list,
} else {
// Handle match of regexp with group names.
*name = '^';
- STRCAT(name, "$");
+ strcat(name, "$");
regmatch.regprog = vim_regcomp(name, RE_MAGIC);
if (regmatch.regprog == NULL) {
failed = true;