Yukihiro Nakadaira wrote:
> :help cinoptions-values
> indent.txt
> 323 +N Indent a continuation line (a line that spills onto the
> next) N
> 324 additional characters. (default 'shiftwidth').
> 325 When the previous line ended in a backslash it's doubled.
> 326
> 327 cino= cino=+10 >
> 328 a = b + 9 * a = b + 9 *
> 329 c; c;
>
> > When the previous line ended in a backslash it's doubled.
>
> I think that this sentence is not correct.
> See the following example.
Your examples don't show any context, but it does matter. Lines inside
a method are indented differently than lines at the toplevel.
> With this settings.
> $ vim -u NONE --cmd "set shiftwidth=2 cinoptions=+3 cindent"
>
> Case 1.
>
> 1234567890
> +----------
> 1|a\
> 2| c;
>
> Second line is indented with "+N" amount * 2;
> This is the behavior as described.
>
>
> Case 2.
>
> 1234567890
> +----------
> 1|a = b + \
> 2| c;
>
> When '=' operator is used, second line is aligned with the first rhs
> character in the previous line.
>
> (without backslach, no indent)
> 1234567890
> +----------
> 1|a = b +
> 2|c;
>
>
> Case 3.
>
> 1234567890
> +----------
> 1|a b \
> 2| c;
> 3|a b \
> 4| c;
>
> 1234567890
> +----------
> 1|a \
> 2| c;
> 3|a \
> 4| c;
>
> When previous line has space, second line is indented with the position
> of the second non-whitespace character in the previous line + "+N" amount.
>
>
> Case 4.
>
> 1234567890
> +----------
> 1|int main()
> 2|{
> 3| a = b + \
> 4| c;
> 5|}
>
> Second line is aligned with first rhs character in the previous line.
> Same as case 2.
>
> (without backslach, previous line's indent + "+N" amount)
> 1234567890
> +----------
> 1|int main()
> 2|{
> 3| a = b +
> 4| c;
> 5|}
>
>
> Case 5.
>
> 1234567890
> +----------
> 1|int main()
> 2|{
> 3| a\
> 4| c;
> 5|}
>
> 1234567890
> +----------
> 1|int main()
> 2|{
> 3| a b \
> 4| c;
> 5| a b \
> 6| c;
> 7|}
>
> 1234567890
> +----------
> 1|int main()
> 2|{
> 3| a \
> 4| c;
> 5| a \
> 6| c;
> 7|}
>
> 1234567890
> +----------
> 1|int main()
> 2|{
> 3| a b
> 4| c;
> 5| a
> 6| c;
> 7|}
>
> When previous line has indent, second line is indented with previous
> line's indent + "+N" amount (with or without backslash).
> Different with case 3.
What's not clear to me is where this is a mistake in the documentation
and where the implementation would need to be changed.
I think it's best to judge this on valid code, not on arbitrary
sequences of characters that would be a C syntax error.
At the toplevel, it's strange that a wrapped initialization is not
indented:
char * veryLongName =
"very long string"
Should be:
char * veryLongName =
"very long string"
--
You can be stopped by the police for biking over 65 miles per hour.
You are not allowed to walk across a street on your hands.
[real standing laws in Connecticut, United States of America]
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
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