On 6 June 2012 17:15, Gary Johnson <[email protected]> wrote:
> I'm seeing some unexpected behavior from this patch.
>
>    $ vim -N -u NONE foo.vim
>
> where
>
>    $ cat foo.vim
>    " This is the first line
>    " and this is the second line
>    " -  Now a list item
>    " -  A second list item
>
> Add 'j' to 'formatoptions'
>
>    :set fo+=j
>
> and set 'comments' per the ftplugin/vim.vim runtime file:
>
>    :setlocal com=sO:\"\ -,mO:\"\ \ ,eO:\"\",:\"
> Now move the cursor to the first list item and type J:
>
>    " -  Now a list item " -  A second list item
>
> I expected the " at the start of the second list item to be removed,
> too.

I explicitly disabled the removal of the starting and ending comment
leaders as I thought it would be annoying. But then I think making
sure that we don't remove the ending comment leader and in other
cases checking whether the previous line introduces a comment
should be enough.

The attached patch adds a test and fixes the problem. Please, verify.

Cheers,
Lech

-- 
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

Attachment: formatoptions-j-join-remove-comment-start.patch
Description: Binary data

Raspunde prin e-mail lui