> > I think the new behaviour would also be preferred (probably by
> > everyone) when pressing enter somewhere in the middle of a trailing
> > comment. Just not when pressing end at the end of the line nor when
> > using the o command.
>
> Yes, as the original reporter of this issue, that behaviour sounds
> great to me.
>
> When reflowing a comment (either because of autowrapping due to
> `textwidth`, or hitting Enter in the middle of a comment) I agree that
> continuing the comment by inserting the leader and indenting to the
> start of the comment would be unsurprising, and probably desired by
> everybody.
>
> But when hitting Enter at the end of a line (or hitting `o`), I want
> to continue "the line". And in my mind, "the line" is a line of code
> that just happens to have a comment at the end, so i want the next
> line to be the same: another line of code. If I want a comment at the
> end, I'll put one after typing some code. So indent to the code on the
> previous line, and no comment leader. My original objection was that
> the new behaviour treats `code code code; // comment` as if it's
> *primarily* a comment line, ignoring the fact that it's actually a
> code line too. It assumes that given a line that is part code and part
> comment, the comment is what you want on the next line too. And as we
> all seem to agree, that's not desired by everybody all the time.
The "/" flag in 'formatoptions' was supposed to only stop repeating the
trailing comment on the next line when creating a new line, but I see it
also stops automatic wrapping from working properly. I'll fix that.
The reason to make it work this way was explained several times before:
If the default is to repeat the comment, a simple CTRL-U can remove it
if you don't want it. If the default was to not repeat the comment and
you do want it, you have to manually type the indent and the comment
leader, which is not easy. Especially typing Enter while typing the
comment is ambiguous, it can either mean to insert a line break in the
comment or to start a non-comment line.
--
GALAHAD: Camelot ...
LAUNCELOT: Camelot ...
GAWAIN: It's only a model.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- [email protected] -- 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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20220523121352.A3C501C0EA5%40moolenaar.net.