To: vim_dev@googlegroups.com Subject: Patch 8.2.0840 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.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) Files: src/search.c, src/testdir/dumps/Test_searchstat_3.dump, src/testdir/test_search_stat.vim *** ../vim-8.2.0839/src/search.c 2020-04-29 21:03:51.115170232 +0200 --- src/search.c 2020-05-29 22:46:12.136722047 +0200 *************** *** 1592,1598 **** && !shortmess(SHM_SEARCHCOUNT) && msgbuf != NULL) search_stat(dirc, &pos, show_top_bot_msg, msgbuf, ! (count != 1 || has_offset)); /* * The search command can be followed by a ';' to do another search. --- 1592,1603 ---- && !shortmess(SHM_SEARCHCOUNT) && msgbuf != NULL) search_stat(dirc, &pos, show_top_bot_msg, msgbuf, ! (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. *** ../vim-8.2.0839/src/testdir/dumps/Test_searchstat_3.dump 2020-05-29 22:48:55.300121544 +0200 --- src/testdir/dumps/Test_searchstat_3.dump 2020-05-29 22:46:12.136722047 +0200 *************** *** 0 **** --- 1,10 ---- + |i+0&#ffffff0|f| @72 + >++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |f|o@1|-@57 + |e+0#0000000#ffffff0|n|d|i|f| @69 + @75 + |~+0#4040ff13&| @73 + |~| @73 + |~| @73 + |~| @73 + |~| @73 + |/+0#0000000&|f|o@1| @35|[|1|/|2|]| @11|2|,|2|-|1| @8|A|l@1| *** ../vim-8.2.0839/src/testdir/test_search_stat.vim 2020-04-08 21:50:18.876619651 +0200 --- src/testdir/test_search_stat.vim 2020-05-29 22:46:12.136722047 +0200 *************** *** 186,191 **** --- 186,220 ---- bwipe! endfunc + func Test_search_stat_foldopen() + CheckScreendump + + let lines =<< trim END + set shortmess-=S + setl foldenable foldmethod=indent foldopen-=search + call append(0, ['if', "\tfoo", "\tfoo", 'endif']) + let @/ = 'foo' + call cursor(1,1) + norm n + END + call writefile(lines, 'Xsearchstat1') + + let buf = RunVimInTerminal('-S Xsearchstat1', #{rows: 10}) + call TermWait(buf) + call VerifyScreenDump(buf, 'Test_searchstat_3', {}) + + call term_sendkeys(buf, "n") + call TermWait(buf) + call VerifyScreenDump(buf, 'Test_searchstat_3', {}) + + call term_sendkeys(buf, "n") + call TermWait(buf) + call VerifyScreenDump(buf, 'Test_searchstat_3', {}) + + call StopVimInTerminal(buf) + call delete('Xsearchstat1') + endfunc + func! Test_search_stat_screendump() CheckScreendump *** ../vim-8.2.0839/src/version.c 2020-05-29 22:41:36.929691032 +0200 --- src/version.c 2020-05-29 22:48:01.400321475 +0200 *************** *** 748,749 **** --- 748,751 ---- { /* Add new patch number below this line */ + /**/ + 840, /**/ -- hundred-and-one symptoms of being an internet addict: 206. You religiously respond immediately to e-mail, while ignoring your growing pile of snail mail. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///