Gary Johnson
unread,Feb 19, 2021, 6:32:35 PM2/19/21Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to vim...@googlegroups.com
A change was made to the 'comments' setting in ftplugin/vim.vim at
commit 7ff78465f7057a672a6de0d75d56286da253501b (between 8.2.1175
and 8.2.1176) that introduced a change in formatting behavior that
I think is a bug.
The setting of the 'comments' option was changed from this:
setlocal com=sO:\"\ -,mO:\"\ \ ,eO:\"\",:\"
to this:
setlocal com=sO:\"\ -,mO:\"\ \ ,sO:#\ -,mO:#\ \ ,eO:##,:\",:#
It appears that the purpose was to add # as a comment leader for
Vim9, but the change also removed the end string of the original
three-piece comment definition for the " comment leader.
The problem this causes is that when entering a comment containing
an indented line that contains a ", the comment leader is not
automatically inserted at the start of the next line. Here is an
example, with 'filetype' set to "vim".
" When these lines are ended by pressing <Enter>,
" a " is automatically inserted at the start of
" each next line. This is good.
"
" This line is indented. Pressing <Enter> here
" also automatically starts this line with ".
But because of that second " in the line above, this line
did not start with a ". The comment was terminated. This
is bad.
The attached patch should fix the problem. The patch was made
against Vim 8.2.2519.
Regards,
Gary