summaryrefslogtreecommitdiffstats
path: root/autoload/rustfmt.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2016-06-17 20:47:16 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2016-06-17 20:47:16 +0200
commit40c54bc12b5700f6bffed12209489e1f669f6423 (patch)
tree74b8abded0ba8ce296f3c358fefc16ec04e327a4 /autoload/rustfmt.vim
parent44b3d860cb85ccb4edd52fb0dcf6a4102d12e82a (diff)
downloadvim-polyglot-2.9.2.tar.gz
vim-polyglot-2.9.2.zip
Updatev2.9.2
Diffstat (limited to 'autoload/rustfmt.vim')
-rw-r--r--autoload/rustfmt.vim8
1 files changed, 6 insertions, 2 deletions
diff --git a/autoload/rustfmt.vim b/autoload/rustfmt.vim
index 20fd5852..4cb91d60 100644
--- a/autoload/rustfmt.vim
+++ b/autoload/rustfmt.vim
@@ -29,9 +29,13 @@ function! rustfmt#Format()
let command = g:rustfmt_command . " --write-mode=overwrite "
- let out = systemlist(command . g:rustfmt_options . " " . shellescape(l:tmpname))
+ if exists("*systemlist")
+ let out = systemlist(command . g:rustfmt_options . " " . shellescape(l:tmpname))
+ else
+ let out = split(system(command . g:rustfmt_options . " " . shellescape(l:tmpname)), '\r\?\n')
+ endif
- if v:shell_error == 0
+ if v:shell_error == 0 || v:shell_error == 3
" remove undo point caused via BufWritePre
try | silent undojoin | catch | endtry