comparison src/vim9script.c @ 27215:5b54f413d132 v8.2.4136

patch 8.2.4136: Vim9: the "autoload" argument of ":vim9script" is not useful Commit: https://github.com/vim/vim/commit/fd218c8a36e7ed33f7a205163690c5b7d2f31f8a Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jan 18 16:26:24 2022 +0000 patch 8.2.4136: Vim9: the "autoload" argument of ":vim9script" is not useful Problem: Vim9: the "autoload" argument of ":vim9script" is not useful. Solution: Remove the argument. (closes https://github.com/vim/vim/issues/9555)
author Bram Moolenaar <Bram@vim.org>
date Tue, 18 Jan 2022 17:30:05 +0100
parents 61d6a31a5874
children facb54d20a50
comparison
equal deleted inserted replaced
27214:c2954285f431 27215:5b54f413d132
67 { 67 {
68 #ifdef FEAT_EVAL 68 #ifdef FEAT_EVAL
69 int sid = current_sctx.sc_sid; 69 int sid = current_sctx.sc_sid;
70 scriptitem_T *si; 70 scriptitem_T *si;
71 int found_noclear = FALSE; 71 int found_noclear = FALSE;
72 int found_autoload = FALSE;
73 char_u *p; 72 char_u *p;
74 73
75 if (!getline_equal(eap->getline, eap->cookie, getsourceline)) 74 if (!getline_equal(eap->getline, eap->cookie, getsourceline))
76 { 75 {
77 emsg(_(e_vim9script_can_only_be_used_in_script)); 76 emsg(_(e_vim9script_can_only_be_used_in_script));
93 { 92 {
94 semsg(_(e_duplicate_argument_str), p); 93 semsg(_(e_duplicate_argument_str), p);
95 return; 94 return;
96 } 95 }
97 found_noclear = TRUE; 96 found_noclear = TRUE;
98 }
99 else if (STRNCMP(p, "autoload", 8) == 0 && IS_WHITE_OR_NUL(p[8]))
100 {
101 if (found_autoload)
102 {
103 semsg(_(e_duplicate_argument_str), p);
104 return;
105 }
106 found_autoload = TRUE;
107 if (script_name_after_autoload(si) == NULL)
108 {
109 emsg(_(e_using_autoload_in_script_not_under_autoload_directory));
110 return;
111 }
112 } 97 }
113 else 98 else
114 { 99 {
115 semsg(_(e_invalid_argument_str), eap->arg); 100 semsg(_(e_invalid_argument_str), eap->arg);
116 return; 101 return;