Skip to content

Commit ca6ceb5

Browse files
committed
use single quote as much as possible
1 parent 67cc1a8 commit ca6ceb5

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

autoload/clang_format.vim

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function! s:stringize_options(opts) abort
5050
endfunction
5151

5252
function! s:build_extra_options()
53-
let extra_options = ""
53+
let extra_options = ''
5454

5555
let opts = copy(g:clang_format#style_options)
5656
if has_key(g:clang_format#filetype_style_options, &ft)
@@ -67,7 +67,7 @@ function! s:make_style_options()
6767
return printf("'{BasedOnStyle: %s, IndentWidth: %d, UseTab: %s%s}'",
6868
\ g:clang_format#code_style,
6969
\ (exists('*shiftwidth') ? shiftwidth() : &l:shiftwidth),
70-
\ &l:expandtab==1 ? "false" : "true",
70+
\ &l:expandtab==1 ? 'false' : 'true',
7171
\ extra_options)
7272
endfunction
7373

@@ -78,7 +78,7 @@ function! s:success(result)
7878
endfunction
7979

8080
function! s:error_message(result)
81-
echoerr "clang-format has failed to format."
81+
echoerr 'clang-format has failed to format.'
8282
if a:result =~# '^YAML:\d\+:\d\+: error: unknown key '
8383
echohl ErrorMsg
8484
for l in split(a:result, "\n")[0:1]
@@ -187,15 +187,15 @@ function! s:detect_style_file()
187187
endfunction
188188

189189
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)
191191
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())
193193
else
194-
let args .= " -style=file "
194+
let args .= ' -style=file '
195195
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")))
197197
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)
199199
return s:system(clang_format, join(getline(1, '$'), "\n"))
200200
endfunction
201201
" }}}
@@ -207,7 +207,7 @@ function! clang_format#replace(line1, line2)
207207

208208
let pos_save = getpos('.')
209209
let sel_save = &l:selection
210-
let &l:selection = "inclusive"
210+
let &l:selection = 'inclusive'
211211
let [save_g_reg, save_g_regtype] = [getreg('g'), getregtype('g')]
212212

213213
try
@@ -229,7 +229,7 @@ function! clang_format#replace(line1, line2)
229229
"
230230
let i = stridx(formatted, "\n")
231231
if i == -1 || getline(1) !=# formatted[:i-1]
232-
throw "fallback"
232+
throw 'fallback'
233233
endif
234234

235235
call setreg('g', formatted[i+1:], 'V')
@@ -278,9 +278,9 @@ endfunction
278278
function! clang_format#toggle_auto_format()
279279
let g:clang_format#auto_format = !g:clang_format#auto_format
280280
if g:clang_format#auto_format
281-
echo "Auto clang-format: enabled"
281+
echo 'Auto clang-format: enabled'
282282
else
283-
echo "Auto clang-format: disabled"
283+
echo 'Auto clang-format: disabled'
284284
endif
285285
endfunction
286286
" }}}

0 commit comments

Comments
 (0)