aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/search.c
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2024-06-13 22:20:06 +0100
committerGitHub <noreply@github.com>2024-06-14 05:20:06 +0800
commit43d8435cf84468e776e0a6a98d05ae7bd62583b7 (patch)
treea298243e08d6a29961464e52167d7736a875f477 /src/nvim/search.c
parent6589d058943405a688b9a3bba11d1869a7d318f8 (diff)
downloadrneovim-43d8435cf84468e776e0a6a98d05ae7bd62583b7.tar.gz
rneovim-43d8435cf84468e776e0a6a98d05ae7bd62583b7.tar.bz2
rneovim-43d8435cf84468e776e0a6a98d05ae7bd62583b7.zip
revert: "refactor: use S_LEN macro" (#29319)
revert: "refactor: use S_LEN(s) instead of s, n (#29219)" This reverts commit c37695a5d5f2e8914fff86f3581bed70b4c85d3c.
Diffstat (limited to 'src/nvim/search.c')
-rw-r--r--src/nvim/search.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/nvim/search.c b/src/nvim/search.c
index 5318970d44..bee124e305 100644
--- a/src/nvim/search.c
+++ b/src/nvim/search.c
@@ -543,7 +543,7 @@ void last_pat_prog(regmmatch_T *regmatch)
return;
}
emsg_off++; // So it doesn't beep if bad expr
- search_regcomp(S_LEN(""), NULL, 0, last_idx, SEARCH_KEEP, regmatch);
+ search_regcomp("", 0, NULL, 0, last_idx, SEARCH_KEEP, regmatch);
emsg_off--;
}
@@ -1821,9 +1821,9 @@ pos_T *findmatchlimit(oparg_T *oap, int initc, int flags, int64_t maxtravel)
ptr = skipwhite(linep);
if (*ptr == '#' && pos.col <= (colnr_T)(ptr - linep)) {
ptr = skipwhite(ptr + 1);
- if (strncmp(ptr, S_LEN("if")) == 0
- || strncmp(ptr, S_LEN("endif")) == 0
- || strncmp(ptr, S_LEN("el")) == 0) {
+ if (strncmp(ptr, "if", 2) == 0
+ || strncmp(ptr, "endif", 5) == 0
+ || strncmp(ptr, "el", 2) == 0) {
hash_dir = 1;
}
} else if (linep[pos.col] == '/') { // Are we on a comment?
@@ -1894,9 +1894,9 @@ pos_T *findmatchlimit(oparg_T *oap, int initc, int flags, int64_t maxtravel)
}
if (initc != '#') {
ptr = skipwhite(skipwhite(linep) + 1);
- if (strncmp(ptr, S_LEN("if")) == 0 || strncmp(ptr, S_LEN("el")) == 0) {
+ if (strncmp(ptr, "if", 2) == 0 || strncmp(ptr, "el", 2) == 0) {
hash_dir = 1;
- } else if (strncmp(ptr, S_LEN("endif")) == 0) {
+ } else if (strncmp(ptr, "endif", 5) == 0) {
hash_dir = -1;
} else {
return NULL;
@@ -1921,29 +1921,29 @@ pos_T *findmatchlimit(oparg_T *oap, int initc, int flags, int64_t maxtravel)
pos.col = (colnr_T)(ptr - linep);
ptr = skipwhite(ptr + 1);
if (hash_dir > 0) {
- if (strncmp(ptr, S_LEN("if")) == 0) {
+ if (strncmp(ptr, "if", 2) == 0) {
count++;
- } else if (strncmp(ptr, S_LEN("el")) == 0) {
+ } else if (strncmp(ptr, "el", 2) == 0) {
if (count == 0) {
return &pos;
}
- } else if (strncmp(ptr, S_LEN("endif")) == 0) {
+ } else if (strncmp(ptr, "endif", 5) == 0) {
if (count == 0) {
return &pos;
}
count--;
}
} else {
- if (strncmp(ptr, S_LEN("if")) == 0) {
+ if (strncmp(ptr, "if", 2) == 0) {
if (count == 0) {
return &pos;
}
count--;
- } else if (initc == '#' && strncmp(ptr, S_LEN("el")) == 0) {
+ } else if (initc == '#' && strncmp(ptr, "el", 2) == 0) {
if (count == 0) {
return &pos;
}
- } else if (strncmp(ptr, S_LEN("endif")) == 0) {
+ } else if (strncmp(ptr, "endif", 5) == 0) {
count++;
}
}
@@ -3891,7 +3891,7 @@ search_line:
// is not considered to be a comment line.
if (skip_comments) {
if ((*line != '#'
- || strncmp(skipwhite(line + 1), S_LEN("define")) != 0)
+ || strncmp(skipwhite(line + 1), "define", 6) != 0)
&& get_leader_len(line, NULL, false, true)) {
matched = false;
}