On Tue, May 14, 2024 at 4:10 AM Michael Soyka <[email protected]> wrote:
>
> 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.
I think (but actually I don't write Vim9 scripts myself yet so this is
pure untested theory) that at this point Vim, under Vim9 rules, looks
for a buffer actually named "%" with two double-quotes and a
percent-sign between them, i.e. the equivalent of something like
(IIUC)
:legacy bwipeout \"\%\"
…and of course it doesn't find it.
Best regards,
Tony.
--
--
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/CAJkCKXsB%3D%2BWooQ-iwSz0znt50qgwVV70%3DY04XBm%3DXiVoyDjgHw%40mail.gmail.com.