File tree 2 files changed +7
-7
lines changed
2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 1
1
Format your C family code
2
2
=======================================
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 )
4
4
5
5
This plugin formats your code with specific coding style using [ clang-format] ( http://clang.llvm.org/docs/ClangFormat.html ) .
6
6
@@ -145,10 +145,9 @@ $ clang-format -dump-config
145
145
```
146
146
147
147
clang-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.
149
149
[ CLANG-FORMAT STYLE OPTIONS] ( http://clang.llvm.org/docs/ClangFormatStyleOptions.html )
150
150
151
-
152
151
## License
153
152
154
153
The MIT License (MIT)
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ function! s:system(str, ...) abort
20
20
let command = a: str
21
21
let input = a: 0 >= 1 ? a: 1 : ' '
22
22
23
- if a: 0 == 0
23
+ if a: 0 == 0 || a: 1 == # ' '
24
24
let output = s: has_vimproc () ?
25
25
\ vimproc#system (command ) : system (command )
26
26
elseif a: 0 == 1
@@ -72,8 +72,8 @@ function! s:make_style_options() abort
72
72
endfunction
73
73
74
74
function ! 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 '
77
77
endfunction
78
78
79
79
function ! s: error_message (result) abort
@@ -212,7 +212,8 @@ function! clang_format#format(line1, line2) abort
212
212
endif
213
213
let args .= g: clang_format #extra_args
214
214
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 )
216
217
endfunction
217
218
" }}}
218
219
You can’t perform that action at this time.
0 commit comments