From 0d100032b885f2eedee96fb7ad6dd660943fc5e3 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Tue, 29 Sep 2020 19:53:00 -0400 Subject: 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) https://github.com/vim/vim/commit/6cb0726215519fe94103803e4aa77a355384bcf2 --- src/nvim/search.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/nvim/search.c') diff --git a/src/nvim/search.c b/src/nvim/search.c index a3acf0c27d..b053459c7f 100644 --- a/src/nvim/search.c +++ b/src/nvim/search.c @@ -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. -- cgit