On 2012-06-06, Bram Moolenaar wrote:
> Patch 7.3.541
> Problem:    When joining lines comment leaders need to be removed manually.
> Solution:   Add the 'j' flag to 'formatoptions'. (Lech Lorens)
> Files:            runtime/doc/change.txt, src/edit.c, src/ex_docmd.c, 
> src/misc1.c,
>           src/normal.c, src/ops.c, src/option.h, src/proto/misc1.pro,
>           src/proto/ops.pro, src/search.c, src/testdir/test29.in,
>           src/testdir/test29.ok

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:\"\",:\"

Move the cursor to the first line and type J:

    " This is the first line and this is the second line

As expected.  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.

Regards,
Gary

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

Raspunde prin e-mail lui