Patch 8.2.1823

6 views
Skip to first unread message

Bram Moolenaar

unread,
Oct 10, 2020, 10:45:57 AM10/10/20
to vim...@googlegroups.com

Patch 8.2.1823
Problem: "gN" does not select the matched string.
Solution: Move the cursor to the start of the match.
Files: src/search.c, src/testdir/test_gn.vim


*** ../vim-8.2.1822/src/search.c 2020-10-02 20:35:56.125323766 +0200
--- src/search.c 2020-10-10 16:25:52.954594310 +0200
***************
*** 3047,3053 ****
curwin->w_cursor = end_pos;
if (LT_POS(VIsual, end_pos) && forward)
dec_cursor();
! else if (VIsual_active && LT_POS(curwin->w_cursor, VIsual))
curwin->w_cursor = pos; // put the cursor on the start of the match
VIsual_active = TRUE;
VIsual_mode = 'v';
--- 3047,3053 ----
curwin->w_cursor = end_pos;
if (LT_POS(VIsual, end_pos) && forward)
dec_cursor();
! else if (VIsual_active && LT_POS(curwin->w_cursor, VIsual) && forward)
curwin->w_cursor = pos; // put the cursor on the start of the match
VIsual_active = TRUE;
VIsual_mode = 'v';
*** ../vim-8.2.1822/src/testdir/test_gn.vim 2020-07-30 20:08:46.836890228 +0200
--- src/testdir/test_gn.vim 2020-10-10 16:15:54.264205329 +0200
***************
*** 172,178 ****
normal 0wgNy
call assert_equal('one', @")
set selection&
! endfu

func Test_gn_multi_line()
new
--- 172,187 ----
normal 0wgNy
call assert_equal('one', @")
set selection&
! endfunc
!
! func Test_gN_repeat()
! new
! call setline(1, 'this list is a list with a list of a list.')
! /list
! normal $gNgNgNx
! call assert_equal('list with a list of a list', @")
! bwipe!
! endfunc

func Test_gn_multi_line()
new
*** ../vim-8.2.1822/src/version.c 2020-10-10 16:42:36.379910364 +0200
--- src/version.c 2020-10-10 16:44:16.595641312 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 1823,
/**/

--
hundred-and-one symptoms of being an internet addict:
56. You leave the modem speaker on after connecting because you think it
sounds like the ocean wind...the perfect soundtrack for "surfing the net".

/// 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