Patch 8.2.2519

6 views
Skip to first unread message

Bram Moolenaar

unread,
Feb 15, 2021, 3:35:31 PM2/15/21
to vim...@googlegroups.com

Patch 8.2.2519
Problem: Vim9: no reason to keep strange Vi behavior.
Solution: ":3" and ":3|" both go to line 3. ":|" does not print the line.
(closes #7840)
Files: src/ex_docmd.c, src/testdir/test_vim9_script.vim


*** ../vim-8.2.2518/src/ex_docmd.c 2021-02-14 14:07:31.369787927 +0100
--- src/ex_docmd.c 2021-02-15 21:23:33.783116189 +0100
***************
*** 1957,1968 ****
/*
* strange vi behaviour:
* ":3" jumps to line 3
! * ":3|..." prints line 3
! * ":|" prints current line
*/
if (ea.skip) // skip this if inside :if
goto doend;
! if (*ea.cmd == '|' || (exmode_active && ea.line1 != ea.line2))
{
ea.cmdidx = CMD_print;
ea.argt = EX_RANGE+EX_COUNT+EX_TRLBAR;
--- 1957,1972 ----
/*
* strange vi behaviour:
* ":3" jumps to line 3
! * ":3|..." prints line 3 (not in Vim9 script)
! * ":|" prints current line (not in Vim9 script)
*/
if (ea.skip) // skip this if inside :if
goto doend;
! if ((*ea.cmd == '|' || (exmode_active && ea.line1 != ea.line2))
! #ifdef FEAT_EVAL
! && !vim9script
! #endif
! )
{
ea.cmdidx = CMD_print;
ea.argt = EX_RANGE+EX_COUNT+EX_TRLBAR;
*** ../vim-8.2.2518/src/testdir/test_vim9_script.vim 2021-02-14 22:40:53.233969130 +0100
--- src/testdir/test_vim9_script.vim 2021-02-15 21:28:58.798307833 +0100
***************
*** 22,27 ****
--- 22,38 ----
:3
list
assert_equal('three$', Screenline(&lines))
+
+ # missing command does not print the line
+ var lines =<< trim END
+ vim9script
+ :1|
+ assert_equal('three$', Screenline(&lines))
+ :|
+ assert_equal('three$', Screenline(&lines))
+ END
+ CheckScriptSuccess(lines)
+
bwipe!

# won't generate anything
*** ../vim-8.2.2518/src/version.c 2021-02-15 20:37:58.461374530 +0100
--- src/version.c 2021-02-15 21:25:40.162798991 +0100
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2519,
/**/

--
The early bird gets the worm. The second mouse gets the cheese.

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