Skip to content

Commit 152224f

Browse files
committed
Merge branch 'add/auto_format'
2 parents 67adb66 + fb6341a commit 152224f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

plugin/clang_format.vim

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@ command! -range=% -nargs=0 ClangFormat call clang_format#replace(<line1>, <line2
1212

1313
command! -range=% -nargs=0 ClangFormatEchoFormattedCode echo clang_format#format(<line1>, <line2>)
1414

15-
if 1 || get(g:, 'clang_format#auto_format', 0)
16-
augroup plugin-clang-format-auto-format
17-
autocmd!
18-
autocmd BufWritePre * if &ft ==# 'cpp' | call clang_format#replace(1, line('$')) | endif
19-
augroup END
20-
endif
15+
augroup plugin-clang-format-auto-format
16+
autocmd!
17+
autocmd BufWritePre * if &ft ==# 'cpp' && get(g:, 'clang_format#auto_format', 0) | call clang_format#replace(1, line('$')) | endif
18+
augroup END
2119

2220
let g:loaded_clang_format = 1

0 commit comments

Comments
 (0)