File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 11Format your C family code
22=======================================
3- [ ![ Build Status] ( https://travis-ci.org/rhysd/vim-clang-format.png ?branch=master )] ( https://travis-ci.org/rhysd/vim-clang-format )
3+ [ ![ Build Status] ( https://travis-ci.org/rhysd/vim-clang-format.svg ?branch=master )] ( https://travis-ci.org/rhysd/vim-clang-format )
44
55This plugin formats your code with specific coding style using [ clang-format] ( http://clang.llvm.org/docs/ClangFormat.html ) .
66
@@ -145,10 +145,9 @@ $ clang-format -dump-config
145145```
146146
147147clang-format's documentation and API documentation is useful in some cases.
148- In paticular , the following link is useful to know the information of a key and its value of a style setting.
148+ In particular , the following link is useful to know the information of a key and its value of a style setting.
149149[ CLANG-FORMAT STYLE OPTIONS] ( http://clang.llvm.org/docs/ClangFormatStyleOptions.html )
150150
151-
152151## License
153152
154153 The MIT License (MIT)
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ function! s:system(str, ...) abort
2020 let command = a: str
2121 let input = a: 0 >= 1 ? a: 1 : ' '
2222
23- if a: 0 == 0
23+ if a: 0 == 0 || a: 1 == # ' '
2424 let output = s: has_vimproc () ?
2525 \ vimproc#system (command ) : system (command )
2626 elseif a: 0 == 1
@@ -72,8 +72,8 @@ function! s:make_style_options() abort
7272endfunction
7373
7474function ! s: success (result) abort
75- return (s: has_vimproc () ? vimproc#get_last_status () : v: shell_error ) == 0
76- \ && a: result !~# ' ^YAML:\d\+:\d\+: error: unknown key '
75+ let exit_success = (s: has_vimproc () ? vimproc#get_last_status () : v: shell_error ) == 0
76+ return exit_success && a: result !~# ' ^YAML:\d\+:\d\+: error: unknown key '
7777endfunction
7878
7979function ! s: error_message (result) abort
@@ -212,7 +212,8 @@ function! clang_format#format(line1, line2) abort
212212 endif
213213 let args .= g: clang_format #extra_args
214214 let clang_format = printf (' %s %s --' , s: shellescape (g: clang_format #command ), args )
215- return s: system (clang_format, join (getline (1 , ' $' ), " \n " ))
215+ let source = join (getline (1 , ' $' ), " \n " )
216+ return s: system (clang_format, source )
216217endfunction
217218" }}}
218219
You can’t perform that action at this time.
0 commit comments