diff options
author | James <89495599+IAKOBVS@users.noreply.github.com> | 2024-06-11 22:40:24 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-11 16:40:24 +0100 |
commit | c37695a5d5f2e8914fff86f3581bed70b4c85d3c (patch) | |
tree | 89c5f523768f3fe31a938e497fb7ff9657049e4b /src/nvim/syntax.c | |
parent | 44410d063ad23544f87d1c8a553de336ae7939d8 (diff) | |
download | rneovim-c37695a5d5f2e8914fff86f3581bed70b4c85d3c.tar.gz rneovim-c37695a5d5f2e8914fff86f3581bed70b4c85d3c.tar.bz2 rneovim-c37695a5d5f2e8914fff86f3581bed70b4c85d3c.zip |
refactor: use S_LEN(s) instead of s, n (#29219)
Diffstat (limited to 'src/nvim/syntax.c')
-rw-r--r-- | src/nvim/syntax.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index c13619797a..24363008c1 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -3186,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); } @@ -4296,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)); @@ -4815,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') { |