@@ -50,7 +50,7 @@ function! s:stringize_options(opts) abort
50
50
endfunction
51
51
52
52
function ! s: build_extra_options ()
53
- let extra_options = " "
53
+ let extra_options = ' '
54
54
55
55
let opts = copy (g: clang_format #style_options)
56
56
if has_key (g: clang_format #filetype_style_options, &ft )
@@ -67,7 +67,7 @@ function! s:make_style_options()
67
67
return printf (" '{BasedOnStyle: %s, IndentWidth: %d, UseTab: %s%s}'" ,
68
68
\ g: clang_format #code_style,
69
69
\ (exists (' *shiftwidth' ) ? shiftwidth () : &l: shiftwidth ),
70
- \ &l: expandtab== 1 ? " false" : " true" ,
70
+ \ &l: expandtab== 1 ? ' false' : ' true' ,
71
71
\ extra_options)
72
72
endfunction
73
73
@@ -78,7 +78,7 @@ function! s:success(result)
78
78
endfunction
79
79
80
80
function ! s: error_message (result)
81
- echoerr " clang-format has failed to format."
81
+ echoerr ' clang-format has failed to format.'
82
82
if a: result = ~# ' ^YAML:\d\+:\d\+: error: unknown key '
83
83
echohl ErrorMsg
84
84
for l in split (a: result , " \n " )[0 :1 ]
@@ -187,15 +187,15 @@ function! s:detect_style_file()
187
187
endfunction
188
188
189
189
function ! clang_format#format (line1, line2)
190
- let args = printf (" -lines=%d:%d" , a: line1 , a: line2 )
190
+ let args = printf (' -lines=%d:%d' , a: line1 , a: line2 )
191
191
if ! (g: clang_format #detect_style_file && s: detect_style_file ())
192
- let args .= printf (" -style=%s " , s: make_style_options ())
192
+ let args .= printf (' -style=%s ' , s: make_style_options ())
193
193
else
194
- let args .= " -style=file "
194
+ let args .= ' -style=file '
195
195
endif
196
- let args .= printf (" -assume-filename=%s " , s: shellescape (escape (expand (' %' ), " \t " )))
196
+ let args .= printf (' -assume-filename=%s ' , s: shellescape (escape (expand (' %' ), " \t " )))
197
197
let args .= g: clang_format #extra_args
198
- let clang_format = printf (" %s %s --" , s: shellescape (g: clang_format #command ), args )
198
+ let clang_format = printf (' %s %s --' , s: shellescape (g: clang_format #command ), args )
199
199
return s: system (clang_format, join (getline (1 , ' $' ), " \n " ))
200
200
endfunction
201
201
" }}}
@@ -207,7 +207,7 @@ function! clang_format#replace(line1, line2)
207
207
208
208
let pos_save = getpos (' .' )
209
209
let sel_save = &l: selection
210
- let &l: selection = " inclusive"
210
+ let &l: selection = ' inclusive'
211
211
let [save_g_reg, save_g_regtype] = [getreg (' g' ), getregtype (' g' )]
212
212
213
213
try
@@ -229,7 +229,7 @@ function! clang_format#replace(line1, line2)
229
229
"
230
230
let i = stridx (formatted, " \n " )
231
231
if i == -1 || getline (1 ) !=# formatted[:i - 1 ]
232
- throw " fallback"
232
+ throw ' fallback'
233
233
endif
234
234
235
235
call setreg (' g' , formatted[i + 1 :], ' V' )
@@ -278,9 +278,9 @@ endfunction
278
278
function ! clang_format#toggle_auto_format ()
279
279
let g: clang_format #auto_format = ! g: clang_format #auto_format
280
280
if g: clang_format #auto_format
281
- echo " Auto clang-format: enabled"
281
+ echo ' Auto clang-format: enabled'
282
282
else
283
- echo " Auto clang-format: disabled"
283
+ echo ' Auto clang-format: disabled'
284
284
endif
285
285
endfunction
286
286
" }}}
0 commit comments