Skip to content

Commit 471f6d6

Browse files
committed
tiny fixes for -assume-filename
- it needs trailing space for succeeding arguments - shellescape() doesn't escape whitespace (sorry)
1 parent 2c4db71 commit 471f6d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

autoload/clang_format.vim

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

0 commit comments

Comments
 (0)