Patch 8.2.1382
Problem:    Vim9: using :import in filetype plugin gives an error.
Solution:   Allow commands with the EX_LOCK_OK flag. (closes #6636)
Files:      src/ex_docmd.c, src/testdir/test_vim9_script.vim


*** ../vim-8.2.1381/src/ex_docmd.c      2020-08-02 20:40:40.085339814 +0200
--- src/ex_docmd.c      2020-08-06 22:10:53.601105270 +0200
***************
*** 2087,2093 ****
        // Do allow ":checktime" (it is postponed).
        // Do allow ":edit" (check for an argument later).
        // Do allow ":file" with no arguments (check for an argument later).
!       if (!(ea.argt & EX_CMDWIN)
                && ea.cmdidx != CMD_checktime
                && ea.cmdidx != CMD_edit
                && ea.cmdidx != CMD_file
--- 2087,2093 ----
        // Do allow ":checktime" (it is postponed).
        // Do allow ":edit" (check for an argument later).
        // Do allow ":file" with no arguments (check for an argument later).
!       if (!(ea.argt & (EX_CMDWIN | EX_LOCK_OK))
                && ea.cmdidx != CMD_checktime
                && ea.cmdidx != CMD_edit
                && ea.cmdidx != CMD_file
*** ../vim-8.2.1381/src/testdir/test_vim9_script.vim    2020-08-05 
16:19:57.859592754 +0200
--- src/testdir/test_vim9_script.vim    2020-08-06 22:09:51.993271805 +0200
***************
*** 1381,1386 ****
--- 1381,1416 ----
    nunmap trigger
  enddef
  
+ def Test_import_in_filetype()
+   # check that :import works when the buffer is locked
+   mkdir('ftplugin', 'p')
+   let export_lines =<< trim END
+     vim9script
+     export let That = 'yes'
+   END
+   writefile(export_lines, 'ftplugin/Xexport_that.vim')
+ 
+   let import_lines =<< trim END
+     vim9script
+     import That from './Xexport_that.vim'
+     assert_equal('yes', That)
+     g:did_load_mytpe = 1
+   END
+   writefile(import_lines, 'ftplugin/qf.vim')
+ 
+   let save_rtp = &rtp
+   &rtp = getcwd() .. ',' .. &rtp
+ 
+   filetype plugin on
+   copen
+   assert_equal(1, g:did_load_mytpe)
+ 
+   quit!
+   delete('Xexport.vim')
+   delete('ftplugin', 'rf')
+   &rtp = save_rtp
+ enddef
+ 
  def Test_vim9script_fails()
    CheckScriptFailure(['scriptversion 2', 'vim9script'], 'E1039:')
    CheckScriptFailure(['vim9script', 'scriptversion 2'], 'E1040:')
*** ../vim-8.2.1381/src/version.c       2020-08-06 21:47:05.588778669 +0200
--- src/version.c       2020-08-06 21:58:52.443024620 +0200
***************
*** 756,757 ****
--- 756,759 ----
  {   /* Add new patch number below this line */
+ /**/
+     1382,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
137. You decide to stay in college for an additional year or two,
     just so you can have the free Internet access.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202008062011.076KBZhO3668146%40masaka.moolenaar.net.

Raspunde prin e-mail lui