rhysd/vim-clang-format

'auto_format_on_insert_leave' conflicts with 'auto-pairs' to me

Snape3058 opened this issue · 0 comments

when I set g:clang_format#auto_format_on_insert_leave to 1, it conflicts with the brace auto line breaking provided by auto-pairs. In auto-pairs, when the cursor is between a pair of braces in insert mode ({|}, the pipe sign represents the cursor), if I press enter, it should insert \ns and indents.
e.g.
before press enter:

class a {|};

after press enter:

class a {
    |
};

However, the process will trigger clang-format to format the code to:

class a {};
|

This problem is currently affecting the namespace statements, struct statements and class statements.
Does any one have any idea to solve this problem? Or, should I forward this issue to the author of 'auto-pairs'?

thx