Chris,

Thank you for the explanation but I don't think it explains everything.  See below.

On 05/13/2024 4:15 PM, Christian Brabandt wrote:
On Mo, 13 Mai 2024, Michael Soyka wrote:

Yes, your are right- the bwipeout command succeeds without the double
quotes in vim9script.  Thanks for the solution!

Given that, what feature of vim9script causes the error when double
quotes are used?  In legacy vimscript, it doesn't matter if double
quotes are present or not.  Perhaps this should be added to
vim9-differences documentation.
[...]
                 bwipeout "%"
There is a slight difference here. Remember that `"` is the comment
character in legacy Vim Script, so what Vim actually sees and runs is:

                 :bwipeout
Yes, I completely overlooked the end-of-line comment possibility and your explanation makes perfect sense.  When in doubt, RTFM!

On Vim9 Script, I think it sees the whole argument "%" and expands to
the current buffer name. So by coincidence it behaves the same, but just
because :bw will wipe the current buffer if no argument has been given.

Actually, if I disassemble the Vim9-script function (what I should have done earlier), what I see is :

    EXEC bwipeout "%"

and, if executed according to legacy rules, would be equivalent to 'EXEC bwipeout' and that should succeed but instead it fails with error E94.  On the other hand, if it substitutes the buffer name, that should also succeed but it fails with E94.


Thanks,
Chris

--
--
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 vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/a201dc71-3ba1-4719-afc1-51fe06bce926%40gmail.com.

Raspunde prin e-mail lui