patch 8.2.4727: unused code
Problem: Unused code.
Solution: Remove code and add #ifdefs. (Dominique Pellé, closes #10136)
diff --git a/src/search.c b/src/search.c
index a66075f..6a52415 100644
--- a/src/search.c
+++ b/src/search.c
@@ -1377,8 +1377,8 @@
*/
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 @@
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 @@
/*
* 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 @@
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 @@
}
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 @@
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 @@
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 @@
{
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 @@
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);
-}