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)
/*
* strange vi behaviour:
* ":3" jumps to line 3
- * ":3|..." prints line 3
- * ":|" prints current line
+ * ":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))
+ 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;
: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
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2519,
/**/
2518,
/**/