Skip to content

Commit d5fcee4

Browse files
committed
Merge pull request rhysd#37 from beyondmarc/fix_assume_filename
Revert last Pull Request, and use the relative filename for -assume-filename command line argument
2 parents 1dd7d8e + 0e1e5a4 commit d5fcee4

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

autoload/clang_format.vim

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,7 @@ function! clang_format#format(line1, line2)
158158
else
159159
let args .= " -style=file "
160160
endif
161-
let v = clang_format#get_version()
162-
if (v[0] == 3 && v[1] >= 8) || v[0] > 3
163-
let args .= printf("-assume-filename=%s ", shellescape(escape(expand('%:p'), " \t")))
164-
endif
161+
let args .= printf("-assume-filename=%s ", shellescape(escape(expand('%'), " \t")))
165162
let args .= g:clang_format#extra_args
166163
let clang_format = printf("%s %s --", g:clang_format#command, args)
167164
return s:system(clang_format, join(getline(1, '$'), "\n"))

0 commit comments

Comments
 (0)