Patch 8.2.0648
Problem: Semicolon search does not work in first line.
Solution: Allow the cursor to be in line zero. (Christian Brabandt,
closes #5996)
Files: src/ex_docmd.c, src/testdir/test_cmdline.vim
*** ../vim-8.2.0647/src/ex_docmd.c 2020-04-20 17:46:10.592551923 +0200
--- src/ex_docmd.c 2020-04-27 19:14:41.768540957 +0200
***************
*** 3069,3076 ****
if (!eap->skip)
{
curwin->w_cursor.lnum = eap->line2;
! // don't leave the cursor on an illegal line or column
! check_cursor();
}
}
else if (*eap->cmd != ',')
--- 3069,3078 ----
if (!eap->skip)
{
curwin->w_cursor.lnum = eap->line2;
! // Don't leave the cursor on an illegal line or column, but do
! // accept zero as address, so 0;/PATTERN/ works correctly.
! if (eap->line2 > 0)
! check_cursor();
}
}
else if (*eap->cmd != ',')
*** ../vim-8.2.0647/src/testdir/test_cmdline.vim 2020-04-21 22:19:26.059486839 +0200
--- src/testdir/test_cmdline.vim 2020-04-27 19:12:29.384942742 +0200
***************
*** 1471,1474 ****
--- 1471,1485 ----
call assert_equal(1, winnr('$'))
endfunc
+ " test that ";" works to find a match at the start of the first line
+ func Test_zero_line_search()
+ new
+ call setline(1, ["1, pattern", "2, ", "3, pattern"])
+ call cursor(1,1)
+ 0;/pattern/d
+ call assert_equal(["2, ", "3, pattern"], getline(1,'$'))
+ q!
+ endfunc
+
+
" vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.0647/src/version.c 2020-04-26 19:00:03.835249027 +0200
--- src/version.c 2020-04-27 19:13:48.616701452 +0200
***************
*** 748,749 ****
--- 748,751 ----
{ /* Add new patch number below this line */
+ /**/
+ 648,
/**/
--
Bypasses are devices that allow some people to dash from point A to
point B very fast while other people dash from point B to point A very
fast. People living at point C, being a point directly in between, are
often given to wonder what's so great about point A that so many people
from point B are so keen to get there and what's so great about point B
that so many people from point A are so keen to get there. They often
wish that people would just once and for all work out where the hell
they wanted to be.
-- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"
/// 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 ///