summaryrefslogtreecommitdiff
path: root/src/search.c
diff options
context:
space:
mode:
authorDominique Pelle <dominique.pelle@gmail.com>2022-04-10 11:26:53 +0100
committerBram Moolenaar <Bram@vim.org>2022-04-10 11:26:53 +0100
commit7765f5cf964c751cd780484220bb65773b1b0348 (patch)
treeb734e3be68a3a3176b1eaf4de04f5389bbca54eb /src/search.c
parent6013d0045dec7ca7c0068fbe186c42d754a7368b (diff)
downloadvim-git-7765f5cf964c751cd780484220bb65773b1b0348.tar.gz
patch 8.2.4727: unused codev8.2.4727
Problem: Unused code. Solution: Remove code and add #ifdefs. (Dominique Pellé, closes #10136)
Diffstat (limited to 'src/search.c')
-rw-r--r--src/search.c48
1 files changed, 18 insertions, 30 deletions
diff --git a/src/search.c b/src/search.c
index a66075fba..6a52415e7 100644
--- a/src/search.c
+++ b/src/search.c
@@ -1377,8 +1377,8 @@ do_search(
*/
if (*p == '+' || *p == '-' || VIM_ISDIGIT(*p))
spats[0].off.line = TRUE;
- else if ((options & SEARCH_OPT) &&
- (*p == 'e' || *p == 's' || *p == 'b'))
+ else if ((options & SEARCH_OPT)
+ && (*p == 'e' || *p == 's' || *p == 'b'))
{
if (*p == 'e') // end
spats[0].off.end = SEARCH_END;
@@ -1404,9 +1404,9 @@ do_search(
pat = p; // put pat after search command
}
- if ((options & SEARCH_ECHO) && messaging() &&
- !msg_silent &&
- (!cmd_silent || !shortmess(SHM_SEARCHCOUNT)))
+ if ((options & SEARCH_ECHO) && messaging()
+ && !msg_silent
+ && (!cmd_silent || !shortmess(SHM_SEARCHCOUNT)))
{
char_u *trunc;
char_u off_buf[40];
@@ -2450,8 +2450,8 @@ findmatchlimit(
/*
* If FM_BLOCKSTOP given, stop at a '{' or '}' in column 0.
*/
- if (pos.col == 0 && (flags & FM_BLOCKSTOP) &&
- (linep[0] == '{' || linep[0] == '}'))
+ if (pos.col == 0 && (flags & FM_BLOCKSTOP)
+ && (linep[0] == '{' || linep[0] == '}'))
{
if (linep[0] == findc && count == 0) // match!
return &pos;
@@ -2653,8 +2653,8 @@ findmatchlimit(
pos.col -= 2;
break;
}
- else if (linep[pos.col - 2] == '\\' &&
- pos.col > 2 && linep[pos.col - 3] == '\'')
+ else if (linep[pos.col - 2] == '\\'
+ && pos.col > 2 && linep[pos.col - 3] == '\'')
{
pos.col -= 3;
break;
@@ -2663,8 +2663,8 @@ findmatchlimit(
}
else if (linep[pos.col + 1]) // forward search
{
- if (linep[pos.col + 1] == '\\' &&
- linep[pos.col + 2] && linep[pos.col + 3] == '\'')
+ if (linep[pos.col + 1] == '\\'
+ && linep[pos.col + 2] && linep[pos.col + 3] == '\'')
{
pos.col += 3;
break;
@@ -3471,8 +3471,9 @@ find_pattern_in_path(
if (fullpathcmp(new_fname, files[i].name, TRUE, TRUE)
& FPC_SAME)
{
- if (type != CHECK_PATH &&
- action == ACTION_SHOW_ALL && files[i].matched)
+ if (type != CHECK_PATH
+ && action == ACTION_SHOW_ALL
+ && files[i].matched)
{
msg_putchar('\n'); // cursor below last one
if (!got_int) // don't display if 'q'
@@ -4678,8 +4679,8 @@ fuzzy_match_in_list(
rettv.v_type = VAR_UNKNOWN;
if (li->li_tv.v_type == VAR_STRING) // list of strings
itemstr = li->li_tv.vval.v_string;
- else if (li->li_tv.v_type == VAR_DICT &&
- (key != NULL || item_cb->cb_name != NULL))
+ else if (li->li_tv.v_type == VAR_DICT
+ && (key != NULL || item_cb->cb_name != NULL))
{
// For a dict, either use the specified key to lookup the string or
// use the specified callback function to get the string.
@@ -4786,8 +4787,8 @@ fuzzy_match_in_list(
{
if (ptrs[i].score == SCORE_NONE)
break;
- if (ptrs[i].lmatchpos != NULL &&
- list_append_list(l, ptrs[i].lmatchpos) == FAIL)
+ if (ptrs[i].lmatchpos != NULL
+ && list_append_list(l, ptrs[i].lmatchpos) == FAIL)
goto done;
}
@@ -5050,16 +5051,3 @@ fuzzymatches_to_strmatches(
return OK;
}
-
-/*
- * Free a list of fuzzy string matches.
- */
- void
-fuzmatch_str_free(fuzmatch_str_T *fuzmatch, int count)
-{
- if (count <= 0 || fuzmatch == NULL)
- return;
- while (count--)
- vim_free(fuzmatch[count].str);
- vim_free(fuzmatch);
-}