diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2020-07-06 19:13:39 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2020-07-06 19:13:39 +0200 |
commit | 8500ae8bb9f4da69273eace4d9cef54ae7f18627 (patch) | |
tree | 85acb09cdf450251a775e23a76a42db7003303d0 /autoload/dart.vim | |
parent | d09a56a494863afd789cba1850e123dfc1dd26cf (diff) | |
download | vim-polyglot-8500ae8bb9f4da69273eace4d9cef54ae7f18627.tar.gz vim-polyglot-8500ae8bb9f4da69273eace4d9cef54ae7f18627.zip |
Update
Diffstat (limited to 'autoload/dart.vim')
-rw-r--r-- | autoload/dart.vim | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/autoload/dart.vim b/autoload/dart.vim index 367e54e4..52d76c02 100644 --- a/autoload/dart.vim +++ b/autoload/dart.vim @@ -27,12 +27,16 @@ function! s:clearQfList(reason) abort endif endfunction -function! dart#fmt(q_args) abort - let cmd = s:FindDartFmt() - if type(cmd) != type('') | return | endif +function! dart#fmt(...) abort + let l:dartfmt = s:FindDartFmt() + if type(l:dartfmt) != type('') | return | endif let buffer_content = getline(1, '$') - let args = '--stdin-name '.expand('%').' '.a:q_args - let lines = systemlist(printf('%s %s', cmd, args), join(buffer_content, "\n")) + let l:cmd = [l:dartfmt, '--stdin-name', shellescape(expand('%'))] + if exists('g:dartfmt_options') + call extend(l:cmd, g:dartfmt_options) + endif + call extend(l:cmd, a:000) + let lines = systemlist(join(l:cmd), join(buffer_content, "\n")) " TODO(https://github.com/dart-lang/sdk/issues/38507) - Remove once the " tool no longer emits this line on SDK upgrades. if lines[-1] ==# 'Isolate creation failed' |