Skip to content

Commit 903158b

Browse files
committed
initialize g:clang_format#auto_format in autoload file
1 parent ef933e6 commit 903158b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

autoload/clang_format.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ let g:clang_format#code_style = s:getg('clang_format#code_style', 'google')
105105
let g:clang_format#style_options = s:getg('clang_format#style_options', {})
106106

107107
let g:clang_format#detect_style_file = s:getg('clang_format#detect_style_file', 1)
108+
let g:clang_format#auto_format = s:getg('clang_format#auto_format', 0)
108109
" }}}
109110

110111
" check version of clang-format "{{{

plugin/clang_format.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ command! -range=% -nargs=0 ClangFormatEchoFormattedCode echo clang_format#format
1414

1515
augroup plugin-clang-format-auto-format
1616
autocmd!
17-
autocmd BufWritePre * if &ft ==# 'cpp' && get(g:, 'clang_format#auto_format', 0) | call clang_format#replace(1, line('$')) | endif
17+
autocmd BufWritePre * if &ft ==# 'cpp' && g:clang_format#auto_format | call clang_format#replace(1, line('$')) | endif
1818
augroup END
1919

2020
let g:loaded_clang_format = 1

0 commit comments

Comments
 (0)