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 -- [email protected] -- 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 ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202006022006.052K6q4R317974%40masaka.moolenaar.net.