diff src/search.c @ 20573:00fff78a929a v8.2.0840

patch 8.2.0840: search match count wrong when only match is in fold Commit: https://github.com/vim/vim/commit/6cb0726215519fe94103803e4aa77a355384bcf2 Author: Bram Moolenaar <Bram@vim.org> Date: Fri May 29 22:49:43 2020 +0200 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)
author Bram Moolenaar <Bram@vim.org>
date Fri, 29 May 2020 23:00:04 +0200
parents 6ca6a372fef6
children 8a2b86a39ef4
line wrap: on
line diff
--- a/src/search.c
+++ b/src/search.c
@@ -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.