Manuel Ortega wrote:

> > Manuel Ortega wrote: 
> >
> > > I very much hope that one thing will be changed. Currently '#' only 
> > starts 
> > > a comment when it's followed by a space, if I understand correctly. 
> > Please 
> > > make it instead behave like almost every other language that uses '#' as 
> > a 
> > > comment character, and *don't* require that it be followed by a space. 
> > > 
> > > The choice of '"' as the comment character in vimscript of course proved 
> > a 
> > > bit awkward, but forcing it to be '#<space>' rather than '#' is even 
> > worse 
> > > IMO. 
> > > 
> > > I note that if you look in the dictionary of comment characters found 
> > > inside the popular NerdCommenter plugin, there are exactly ZERO entries 
> > for 
> > > which '#<space>' is mandatory. There are five entries that indicate a 
> > > style preference for '#<space>' but allow '#'. And there are 134 entries 
> > > for which '#', with no following space, is a comment character. (For 125 
> > > of these 134, that's the primary or sole comment character). 
> > > 
> > > If one of the goals of vim9script is to be more like what a user 
> > expects, 
> > > then '#' and not '#<space>' should be the comment-starter. 
> >
> > Where do you read that there must be a space after the #?
> 
> 
> Ah, it seems I misremembered the details.  But my point remains pretty much 
> the same.  I'd said it was unexpected for the comment char of vim9script to 
> be '#<space>'; it's at least as unexpected for it to be '<space>#', and 
> even more unexpected for it to be "'<space>#', unless it's the start of the 
> line".  That makes things worse than the old way, not better.
> 
> Otherwise it could be confused with an autoload script item.
> 
> 
> Then the right thing to do would be to change the autoload syntax to not 
> use '#'.  The main point of vim9script is to break backwards compatibility 
> to "fix" stuff, right?  I would say having a normal and sensible 
> comment-char, after all these years of an awkward one, it more important 
> than keeping the autoload syntax the same.
> 
> And it definitely doesn't behave more like other langs (which seems to be 
> one of vim9's goals).  '#' in bash, ruby, etc. don't require a space 
> beforehand.  There are ZERO entries in the aforementioned NerdCommenter 
> dictionary for '<space>#'.

Although the shell accepts "anything#comment", I have seen many style
guides that do require a space before the "#".  And some companies
require it (presubmit check).

I can't think of an alternative for "#" that would work better.


-- 
GALAHAD: No. Look, I can tackle this lot single-handed!
GIRLS:   Yes, yes, let him Tackle us single-handed!
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            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 vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220112202748.5EBC51C2175%40moolenaar.net.

Raspunde prin e-mail lui