Friday, June 1, 2012

Re: formatoptions q (comments) and 2 (2nd line) bad together...?

On 01/06/12 20:25, Tor Perkins wrote:
>
> Greetings all,
>
> Given these settings:
>
> :set tw=20
> :set comments=b:#
> :set formatoptions=tcq2
> :set smartindent
>
> ... and given this text:
>
> NOTE: blah blah
> blah blah
>
> # NOTE: blah blah
> # blah blah
>
> If I do gq{motion} on the top paragraph, formatting is unchanged (as
> expected), however, gq{motion} (or gwap) on the bottom paragraph
> results in this new formatting:
>
> # NOTE: blah blah
> # blah blah
>
> So, even though I have both the 2 and q formatoptions, the second
> line's indentation seems to be ignored when within a comment block.
> I would prefer if it could be honored in this case as well. Is that
> possible...?
>
> Interestingly, the t and c formatoptions (for auto-wrap) are working
> properly with formatoptions+=2 in both paragraphs...
>
> Thanks for your consideration.
>
> - Tor
>
> PS - I'm running Vim 7.2.445 on Debian Linux, but I see the same
> behaviour in Vim 7.3.154 on OpenBSD...
>


There have been quite a number of fixes to indenting code since 7.3.154,
see http://ftp.vim.org/pub/vim/patches/7.3/README

You might try to install the latest Vim (7.3.538) and see if you still
have the problem.

See:
http://vim.wikia.com/wiki/Getting_the_Vim_source_with_Mercurial
http://users.skynet.be/antoine.mechelynck/vim/compunix.htm

N.B. There exists an apt-get command to get all the dependency packages
necessary to compile gvim, but I don't know it since I'm on a Linux
distro (openSUSE) which uses a different kind of package management. I
recommend running this apt-get command after getting the Vim sources
with Mercurial (to someplace where they won't be disturbed, as explained
in the links above) but before running configure.


Best regards,
Tony.
--
"How do I love thee? My accumulator overflows."

--
You received this message from the "vim_use" 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

No comments:

Post a Comment