1
0
forked from aniani/vim

patch 8.2.0840: search match count wrong when only match is in fold

Problem:    Search match count wrong when only match is in fold.
Solution:   Update search stats when in a closed fold. (Christian Brabandt,
            closes #6160, closes #6152)
This commit is contained in:
Bram Moolenaar
2020-05-29 22:49:43 +02:00
parent b42c0d5427
commit 6cb0726215
4 changed files with 47 additions and 1 deletions

View File

@@ -1592,7 +1592,12 @@ do_search(
&& !shortmess(SHM_SEARCHCOUNT)
&& msgbuf != NULL)
search_stat(dirc, &pos, show_top_bot_msg, msgbuf,
(count != 1 || has_offset));
(count != 1 || has_offset
#ifdef FEAT_FOLDING
|| (!(fdo_flags & FDO_SEARCH) &&
hasFolding(curwin->w_cursor.lnum, NULL, NULL))
#endif
));
/*
* The search command can be followed by a ';' to do another search.