Patch 8.2.2303
Problem:    Vim9: backtick expansion doesn't work for :foldopen.
Solution:   Do recognize backtick expansion. (closes #7621)
Files:      src/vim9compile.c, src/testdir/test_vim9_cmd.vim


*** ../vim-8.2.2302/src/vim9compile.c   2021-01-04 21:57:08.088222062 +0100
--- src/vim9compile.c   2021-01-05 19:22:11.780861802 +0100
***************
*** 7505,7510 ****
--- 7505,7517 ----
        }
      }
  
+     if (eap->cmdidx == CMD_folddoopen || eap->cmdidx == CMD_folddoclosed)
+     {
+       // TODO: should only expand when appropriate for the command
+       eap->arg = skiptowhite(eap->arg);
+       has_expr = TRUE;
+     }
+ 
      if (has_expr && (p = (char_u *)strstr((char *)eap->arg, "`=")) != NULL)
      {
        int     count = 0;
*** ../vim-8.2.2302/src/testdir/test_vim9_cmd.vim       2021-01-04 
16:15:55.066084896 +0100
--- src/testdir/test_vim9_cmd.vim       2021-01-05 19:21:08.637050506 +0100
***************
*** 81,86 ****
--- 81,103 ----
    bwipe!
  enddef
  
+ def Test_folddo_backtick_expansion()
+   new
+   var name = 'xxx'
+   folddoopen edit `=name`
+   assert_equal('xxx', bufname())
+   bwipe!
+ 
+   new
+   setline(1, ['one', 'two'])
+   set nomodified
+   :1,2fold
+   foldclose
+   folddoclose edit `=name`
+   assert_equal('xxx', bufname())
+   bwipe!
+ enddef
+ 
  def Test_hardcopy_wildcards()
    CheckUnix
    CheckFeature postscript
*** ../vim-8.2.2302/src/version.c       2021-01-05 17:50:24.741302345 +0100
--- src/version.c       2021-01-05 19:16:22.661898009 +0100
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     2303,
  /**/

-- 
>From "know your smileys":
 :-| :-|   Deja' vu!

 /// 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/202101051824.105IOnTY2829331%40masaka.moolenaar.net.

Raspunde prin e-mail lui