Mercurial > vim
diff src/vim9execute.c @ 26370:a3a0885d9dd8 v8.2.3716
patch 8.2.3716: Vim9: range without a command is not compiled
Commit: https://github.com/vim/vim/commit/e4eed8c6db693a9183b776032570ce2f89dcffb6
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Dec 1 15:22:56 2021 +0000
patch 8.2.3716: Vim9: range without a command is not compiled
Problem: Vim9: range without a command is not compiled.
Solution: Add the ISN_EXECRANGE byte code.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 01 Dec 2021 16:30:04 +0100 |
parents | c189c40c9a22 |
children | a926ccd92ae1 |
line wrap: on
line diff
--- a/src/vim9execute.c +++ b/src/vim9execute.c @@ -1774,6 +1774,28 @@ exec_instructions(ectx_T *ectx) } break; + // execute Ex command line that is only a range + case ISN_EXECRANGE: + { + exarg_T ea; + char *error = NULL; + + CLEAR_FIELD(ea); + ea.cmdidx = CMD_SIZE; + ea.addr_type = ADDR_LINES; + ea.cmd = iptr->isn_arg.string; + parse_cmd_address(&ea, &error, FALSE); + if (error == NULL) + error = ex_range_without_command(&ea); + if (error != NULL) + { + SOURCING_LNUM = iptr->isn_lnum; + emsg(error); + goto on_error; + } + } + break; + // Evaluate an expression with legacy syntax, push it onto the // stack. case ISN_LEGACY_EVAL: @@ -5068,6 +5090,9 @@ list_instructions(char *pfx, isn_T *inst case ISN_EXEC_SPLIT: smsg("%s%4d EXEC_SPLIT %s", pfx, current, iptr->isn_arg.string); break; + case ISN_EXECRANGE: + smsg("%s%4d EXECRANGE %s", pfx, current, iptr->isn_arg.string); + break; case ISN_LEGACY_EVAL: smsg("%s%4d EVAL legacy %s", pfx, current, iptr->isn_arg.string);