Skip to content

Commit bddd92b

Browse files
author
Mike Grundy
committed
pass -assume-filename so clang-format can figure out file type
1 parent ae2e48a commit bddd92b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

autoload/clang_format.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ function! clang_format#format(line1, line2)
158158
else
159159
let args .= " -style=file "
160160
endif
161+
let args .= printf("-assume-filename=%s", expand('%:p'))
161162
let args .= g:clang_format#extra_args
162163
let clang_format = printf("%s %s --", g:clang_format#command, args)
163164
return s:system(clang_format, join(getline(1, '$'), "\n"))

0 commit comments

Comments
 (0)