summaryrefslogtreecommitdiff
path: root/src/search.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-05-29 22:49:43 +0200
committerBram Moolenaar <Bram@vim.org>2020-05-29 22:49:43 +0200
commit6cb0726215519fe94103803e4aa77a355384bcf2 (patch)
treef7b9a635b37cf16d4fc25cff201eb2bdeba7107a /src/search.c
parentb42c0d54279b1fdb79652db0c84171e213458809 (diff)
downloadvim-git-6cb0726215519fe94103803e4aa77a355384bcf2.tar.gz
patch 8.2.0840: search match count wrong when only match is in foldv8.2.0840
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)
Diffstat (limited to 'src/search.c')
-rw-r--r--src/search.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/search.c b/src/search.c
index 0bf49629e..7bda6f983 100644
--- 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.