We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e1fa55 commit 685f481Copy full SHA for 685f481
autoload/codefmt/clangformat.vim
@@ -129,6 +129,10 @@ function! codefmt#clangformat#GetFormatter() abort
129
""
130
" Reformat buffer with clang-format, only targeting [ranges] if given.
131
function l:formatter.FormatRanges(ranges) abort
132
+ if line('$') == 1 && getline(1) == ''
133
+ " the buffer is empty, bail out since there is nothing to format
134
+ return
135
+ endif
136
let l:Style_value = s:plugin.Flag('clang_format_style')
137
if type(l:Style_value) is# type('')
138
let l:style = l:Style_value
0 commit comments