Patch 8.2.0887

7 views
Skip to first unread message

Bram Moolenaar

unread,
Jun 2, 2020, 4:07:01 PM6/2/20
to vim...@googlegroups.com

Patch 8.2.0887
Problem: Searchcount().exact_match is 1 right after a match.
Solution: Use LT_POS() instead of LTOREQ_POS(). (closes #6189)
Files: src/search.c, src/testdir/test_search_stat.vim


*** ../vim-8.2.0886/src/search.c 2020-06-01 21:32:26.356971229 +0200
--- src/search.c 2020-06-02 22:05:45.717803889 +0200
***************
*** 3252,3258 ****
if (LTOREQ_POS(lastpos, p))
{
cur = cnt;
! if (LTOREQ_POS(p, endpos))
exact_match = TRUE;
}
fast_breakcheck();
--- 3252,3258 ----
if (LTOREQ_POS(lastpos, p))
{
cur = cnt;
! if (LT_POS(p, endpos))
exact_match = TRUE;
}
fast_breakcheck();
*** ../vim-8.2.0886/src/testdir/test_search_stat.vim 2020-06-01 21:32:26.356971229 +0200
--- src/testdir/test_search_stat.vim 2020-06-02 22:05:17.789926936 +0200
***************
*** 27,32 ****
--- 27,40 ----
call assert_equal(
\ #{current: 1, exact_match: 1, total: 10, incomplete: 0, maxcount: 99},
\ searchcount(#{pattern: 'fooooobar', pos: [3, 1, 0]}))
+ " on last char of match
+ call assert_equal(
+ \ #{current: 1, exact_match: 1, total: 10, incomplete: 0, maxcount: 99},
+ \ searchcount(#{pattern: 'fooooobar', pos: [3, 9, 0]}))
+ " on char after match
+ call assert_equal(
+ \ #{current: 1, exact_match: 0, total: 10, incomplete: 0, maxcount: 99},
+ \ searchcount(#{pattern: 'fooooobar', pos: [3, 10, 0]}))
call assert_equal(
\ #{current: 1, exact_match: 0, total: 10, incomplete: 0, maxcount: 99},
\ searchcount(#{pattern: 'fooooobar', pos: [4, 1, 0]}))
*** ../vim-8.2.0886/src/version.c 2020-06-02 21:38:18.719856309 +0200
--- src/version.c 2020-06-02 22:01:23.379022355 +0200
***************
*** 748,749 ****
--- 748,751 ----
{ /* Add new patch number below this line */
+ /**/
+ 887,
/**/

--
hundred-and-one symptoms of being an internet addict:
259. When you enter your name in the AltaVista search engine, the top ten
matches do indeed refer to you.

/// Bram Moolenaar -- Br...@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 ///
Reply all
Reply to author
Forward
0 new messages