]> granicus.if.org Git - vim/commitdiff
patch 8.2.3569: error for :let when vimrc is Vim 9 script v8.2.3569
authorChristian Brabandt <cb@256bit.org>
Mon, 1 Nov 2021 22:44:33 +0000 (22:44 +0000)
committerBram Moolenaar <Bram@vim.org>
Mon, 1 Nov 2021 22:44:33 +0000 (22:44 +0000)
Problem:    Error for :let when vimrc is Vim 9 script.
Solution:   Prepend :legacy in the code for converting arguments. (Christian
            Brabandt, closes #9068, closes #9077)

src/os_win32.c
src/version.c

index 91bd18a8b3b5d0023ec824ffa9edc0fbf6c4af0d..73af6a1817f19a684ab638ac9b0bba84abc530a6 100644 (file)
@@ -7768,11 +7768,14 @@ fix_arg_enc(void)
        // Also, unset wildignore to not be influenced by this option.
        // The arguments specified in command-line should be kept even if
        // encoding options were changed.
-       do_cmdline_cmd((char_u *)":let SaVe_ISF = &isf|set isf+=(,)");
-       do_cmdline_cmd((char_u *)":let SaVe_WIG = &wig|set wig=");
+       // Use :legacy so that it also works when in Vim9 script.
+       do_cmdline_cmd((char_u *)":legacy let g:SaVe_ISF = &isf|set isf+=(,)");
+       do_cmdline_cmd((char_u *)":legacy let g:SaVe_WIG = &wig|set wig=");
        alist_expand(fnum_list, used_alist_count);
-       do_cmdline_cmd((char_u *)":let &isf = SaVe_ISF|unlet SaVe_ISF");
-       do_cmdline_cmd((char_u *)":let &wig = SaVe_WIG|unlet SaVe_WIG");
+       do_cmdline_cmd(
+               (char_u *)":legacy let &isf = g:SaVe_ISF|unlet g:SaVe_ISF");
+       do_cmdline_cmd(
+               (char_u *)":legacy let &wig = g:SaVe_WIG|unlet g:SaVe_WIG");
     }
 
     // If wildcard expansion failed, we are editing the first file of the
index c42cd2ad22200e71b8ffda80336c2a2f9a6b84da..ea1a790ccc6310c1b597fda531ed1b1dece1a93a 100644 (file)
@@ -757,6 +757,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3569,
 /**/
     3568,
 /**/