0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.2598: Vim9: :open does not need to be supported

Problem:    Vim9: :open does not need to be supported.
Solution:   Do not support :open in Vim9 script.
This commit is contained in:
Bram Moolenaar
2021-03-13 21:07:21 +01:00
parent cb4e80fab9
commit 6508880d6c
4 changed files with 9 additions and 0 deletions

View File

@@ -6609,6 +6609,10 @@ ex_open(exarg_T *eap)
regmatch_T regmatch; regmatch_T regmatch;
char_u *p; char_u *p;
#ifdef FEAT_EVAL
if (not_in_vim9(eap) == FAIL)
return;
#endif
curwin->w_cursor.lnum = eap->line2; curwin->w_cursor.lnum = eap->line2;
beginline(BL_SOL | BL_FIX); beginline(BL_SOL | BL_FIX);
if (*eap->arg == '/') if (*eap->arg == '/')

View File

@@ -1880,6 +1880,8 @@ def Test_no_insert_xit()
CheckScriptFailure(['vim9script', 'c'], 'E1100:') CheckScriptFailure(['vim9script', 'c'], 'E1100:')
CheckScriptFailure(['vim9script', 'i = 1'], 'E488:') CheckScriptFailure(['vim9script', 'i = 1'], 'E488:')
CheckScriptFailure(['vim9script', 'i'], 'E1100:') CheckScriptFailure(['vim9script', 'i'], 'E1100:')
CheckScriptFailure(['vim9script', 'o = 1'], 'E1100:')
CheckScriptFailure(['vim9script', 'o'], 'E1100:')
CheckScriptFailure(['vim9script', 't'], 'E1100:') CheckScriptFailure(['vim9script', 't'], 'E1100:')
CheckScriptFailure(['vim9script', 't = 1'], 'E1100:') CheckScriptFailure(['vim9script', 't = 1'], 'E1100:')
CheckScriptFailure(['vim9script', 'x = 1'], 'E1100:') CheckScriptFailure(['vim9script', 'x = 1'], 'E1100:')

View File

@@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
2598,
/**/ /**/
2597, 2597,
/**/ /**/

View File

@@ -102,6 +102,7 @@ not_in_vim9(exarg_T *eap)
case CMD_append: case CMD_append:
case CMD_change: case CMD_change:
case CMD_insert: case CMD_insert:
case CMD_open:
case CMD_t: case CMD_t:
case CMD_xit: case CMD_xit:
semsg(_(e_command_not_supported_in_vim9_script_missing_var_str), eap->cmd); semsg(_(e_command_not_supported_in_vim9_script_missing_var_str), eap->cmd);