Hi Glenn,
2016-4-24(Sun) 6:24:09 UTC+9 Glenn Golden:
> The following is likely just user braindamage on my part, but after hours
> of fiddling with it and reading up on indenting options, I still can't figure
> out what's going on.
>
> The following indented paragraph, call it Paragraph A, gets reformatted
> as expected using 'gqap':
>
> Axx xxxxx xxx xxxxxxx xxxxxxxxx Xxxxxxxxxxxxx xxxxxxxxxxxxxx xxx xxxxx
> foo xxxxxx xxxxxxxx. Xxxxxxx xxxxxxxxxxx xx
> xxxxxxxx xxxxxxx xxxxxxxxxx xxx xxxx xxx xxxxxxxx.
>
> Here is the result:
>
> Axx xxxxx xxx xxxxxxx xxxxxxxxx Xxxxxxxxxxxxx xxxxxxxxxxxxxx xxx xxxxx
> foo xxxxxx xxxxxxxx. Xxxxxxx xxxxxxxxxxx xx xxxxxxxx xxxxxxx xxxxxxxxxx
> xxx xxxx xxx xxxxxxxx.
>
> (The above behavior is what I expect.)
>
> But this paragraph, Paragraph B, doesn't get formatted as expected using
> 'gqap': The last line winds up with an extra level of indentation.
>
> Bxx xxxxx xxx xxxxxxx xxxxxxxxx Xxxxxxxxxxxxx xxxxxxxxxxxxxx xxx xxxxx
> for xxxxxx xxxxxxxx. Xxxxxxx xxxxxxxxxxx xx
> xxxxxxxx xxxxxxx xxxxxxxxxx xxx xxxx xxx xxxxxxxx.
>
> Here is the result:
>
> Bxx xxxxx xxx xxxxxxx xxxxxxxxx Xxxxxxxxxxxxx xxxxxxxxxxxxxx xxx xxxxx
> for xxxxxx xxxxxxxx. Xxxxxxx xxxxxxxxxxx xx xxxxxxxx xxxxxxx xxxxxxxxxx
> xxx xxxx xxx xxxxxxxx.
>
> The only difference between paragraphs A and B is that the word 'foo' in A
> is changed to 'for' in B. So possibly that 'for' is being interpreted as
> a C (or other language) keyword that is fooling the indentation algo somehow?
> But, afaict, C indentation is disabled (see below).
>
> To demo this problem:
>
> 1. Set options as indicated in attached bugreport.txt.
> 2. Place cursor on "Axx" in Paragraph A.
> 3. Do 'gqap'. Observe result is as shown above.
> 4. Place cursor on "Bxx" in Paragraph B.
> 5. Do 'gqap'. Observe result is as shown above.
>
>
> Here are the vim option settings used for the above demo that seemed to
> me to be relevant to this issue:
>
> nocindent
> formatexpr=
> formatprg=
> formatoptions=tcqn
>
> Full bugreport.txt inlined below for all the gory details.
>
> Thank you, and apologies in advance for what is probably a spurious report.
[...]
When the `smartindent` option to off, the result of your expectations will be
obtained.
Please see documents.
:help 'cinwords'
DOC> 'cinwords' 'cinw' string (default "if,else,while,do,for,switch")
DOC> local to buffer
DOC> {not in Vi}
DOC> {not available when compiled without both the
DOC> +cindent and the +smartindent features}
DOC> These keywords start an extra indent in the next line when
DOC> 'smartindent' or 'cindent' is set.
--
Best regards,
Hirohito Higashi (a.k.a. h_east)
--
--
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].
For more options, visit https://groups.google.com/d/optout.