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 vim/vim#6160, closes vim/vim#6152)
6cb0726215
This commit is contained in:
Jan Edmund Lazo
2020-09-29 19:53:00 -04:00
parent 83ebe0c998
commit 0d100032b8
2 changed files with 33 additions and 1 deletions

View File

@@ -1370,7 +1370,10 @@ int do_search(
&& !shortmess(SHM_SEARCHCOUNT)
&& msgbuf != NULL) {
search_stat(dirc, &pos, show_top_bot_msg, msgbuf,
(count != 1 || has_offset));
(count != 1
|| has_offset
|| (!(fdo_flags & FDO_SEARCH)
&& hasFolding(curwin->w_cursor.lnum, NULL, NULL))));
}
// The search command can be followed by a ';' to do another search.