[patch] Fix indentation bug of Preprocessor directive continuation line

19 views
Skip to first unread message

h_east

unread,
Jan 7, 2017, 7:23:18 AM1/7/17
to vim_dev
Hi Bram and list,

How to reproduce:
- Run vanilla Vim with 'cindent'.
$ vim -Nu NONE +"set cindent"
- Input bellow.
i#if aaa\<CR>bbb\<CR>ccc<ESC>

Expect behavior:
#if aaa\
bbb\
ccc

Actual behavior:
#if aaa\
bbb\
ccc


After the third line is not indent well.
NOTE:
This behavior occurs only outside of the curly bracket.

I wrote a patch contains test.
Sorry, it is still the old style test. I'll challenge it in this spring👍

Check it out.

NOTE 2:
This issue was reported by Ken Takata.
--
Best regards,
Hirohito Higashi (a.k.a. h_east)
fix_preproc_cont_indent.patch

Bram Moolenaar

unread,
Jan 7, 2017, 9:01:14 AM1/7/17
to vim...@googlegroups.com, h_east

Hirohito Higashi wrote:

> How to reproduce:
> - Run vanilla Vim with 'cindent'.
> $ vim -Nu NONE +"set cindent"
> - Input bellow.
> i#if aaa\<CR>bbb\<CR>ccc<ESC>
>
> Expect behavior:
> #if aaa\
> bbb\
> ccc
>
> Actual behavior:
> #if aaa\
> bbb\
> ccc
>
>
> After the third line is not indent well.
> NOTE:
> This behavior occurs only outside of the curly bracket.
>
> I wrote a patch contains test.
> Sorry, it is still the old style test. I'll challenge it in this spring

This test might be easier as an old style test.

> Check it out.
>
> NOTE 2:
> This issue was reported by Ken Takata.

Thanks!

--
hundred-and-one symptoms of being an internet addict:
199. You read this entire list of symptoms, looking for something
that doesn't describe you.

/// Bram Moolenaar -- Br...@Moolenaar.net -- 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 ///
Reply all
Reply to author
Forward
0 new messages