Skip to content

Commit 0c48826

Browse files
committed
Merge pull request #32 from peplin/31-warn-against-textwidth
Warn of incompatibility between formatexpr and textwidth.
2 parents 9217fef + 1f05a75 commit 0c48826

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ Formatting is executed on `InsertLeave` event.
8989
- `g:clang_format#auto_formatexpr`
9090

9191
When the value is 1, `formatexpr` option is set by vim-clang-format automatically in C, C++ and ObjC codes.
92-
Vim's format mappings (e.g. `gq`) get to use `clang-format` to format.
92+
Vim's format mappings (e.g. `gq`) get to use `clang-format` to format. This
93+
option is not comptabile with Vim's `textwidth` feature. You must set
94+
`textwidth` to `0` when the `formatexpr` is set.
9395

9496
### Vimrc Example
9597

doc/clang-format.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ g:clang_format#auto_formatexpr *g:clang_format#auto_formatexpr*
189189

190190
When the value is 1, 'formatexpr' option is set automatically in |c|, |cpp|
191191
and |objc| codes. Vim's format mappings (e.g. |gq|) get to use |clang-format|
192-
to format.
192+
to format. This option is not comptabile with Vim's `textwidth` feature. You
193+
must set `textwidth` to `0` when the `formatexpr` is set.
193194

194195

195196

0 commit comments

Comments
 (0)