> > **Describe the bug**
> > 
> > In Vim9 script, we cannot use a backtick expansion in a `:folddoopen` 
> > command, nor in a `:folddoclosed` command.
> > 
> > **To Reproduce**
> > 
> > Run this shell command:
> > 
> >     vim -Nu NONE -S <(cat <<'EOF'
> >         vim9
> >         def Func()
> >             var name = 'test'
> >             folddoopen echo '`=name`'
> >         enddef
> >         Func()
> >     EOF
> >     )
> > 
> > This is echo'ed:
> > 
> >     `=name`
> > 
> > **Expected behavior**
> > 
> > `test` is echo'ed.
> 
> I don't think `=expr` is evaluated for an :echo command.  But the
> problem does reproduce when using :edit, where it is supposed to be
> evaluated.  This works:
> 
> def Edit()
>   var name = 'xxx'
>   edit `=name`
> enddef
> 
> This does not work:
> 
> def Edit()
>   var name = 'xxx'
>   folddoopen edit `=name`
> enddef

Ironically it's a lot simpler to expand `=expr` for any command.
That's probably fine in most cases.

-- 
>From "know your smileys":
 :-E    Has major dental problems

 /// 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.105IOn9I2829337%40masaka.moolenaar.net.

Raspunde prin e-mail lui