comparison src/ex_docmd.c @ 23954:9c8a20cfa540 v8.2.2519

patch 8.2.2519: Vim9: no reason to keep strange Vi behavior Commit: https://github.com/vim/vim/commit/b8554304c3673b081e9b5996f009fd0e4307e482 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Feb 15 21:30:30 2021 +0100 patch 8.2.2519: Vim9: no reason to keep strange Vi behavior 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)
author Bram Moolenaar <Bram@vim.org>
date Mon, 15 Feb 2021 21:45:03 +0100
parents 6e593e0aaadf
children 09bde146adcb
comparison
equal deleted inserted replaced
23953:e902fe2d6be6 23954:9c8a20cfa540
1955 || (ea.nextcmd = check_nextcmd(ea.cmd)) != NULL) 1955 || (ea.nextcmd = check_nextcmd(ea.cmd)) != NULL)
1956 { 1956 {
1957 /* 1957 /*
1958 * strange vi behaviour: 1958 * strange vi behaviour:
1959 * ":3" jumps to line 3 1959 * ":3" jumps to line 3
1960 * ":3|..." prints line 3 1960 * ":3|..." prints line 3 (not in Vim9 script)
1961 * ":|" prints current line 1961 * ":|" prints current line (not in Vim9 script)
1962 */ 1962 */
1963 if (ea.skip) // skip this if inside :if 1963 if (ea.skip) // skip this if inside :if
1964 goto doend; 1964 goto doend;
1965 if (*ea.cmd == '|' || (exmode_active && ea.line1 != ea.line2)) 1965 if ((*ea.cmd == '|' || (exmode_active && ea.line1 != ea.line2))
1966 #ifdef FEAT_EVAL
1967 && !vim9script
1968 #endif
1969 )
1966 { 1970 {
1967 ea.cmdidx = CMD_print; 1971 ea.cmdidx = CMD_print;
1968 ea.argt = EX_RANGE+EX_COUNT+EX_TRLBAR; 1972 ea.argt = EX_RANGE+EX_COUNT+EX_TRLBAR;
1969 if ((errormsg = invalid_range(&ea)) == NULL) 1973 if ((errormsg = invalid_range(&ea)) == NULL)
1970 { 1974 {