From 40c54bc12b5700f6bffed12209489e1f669f6423 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Fri, 17 Jun 2016 20:47:16 +0200 Subject: Update --- autoload/rust.vim | 2 +- autoload/rustfmt.vim | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'autoload') diff --git a/autoload/rust.vim b/autoload/rust.vim index 12591399..fe7ddff8 100644 --- a/autoload/rust.vim +++ b/autoload/rust.vim @@ -348,7 +348,7 @@ function! s:RmDir(path) echoerr 'Attempted to delete protected path: ' . a:path return 0 endif - silent exe "!rm -rf " . shellescape(a:path) + return system("rm -rf " . shellescape(a:path)) endfunction " Executes {cmd} with the cwd set to {pwd}, without changing Vim's cwd. 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 -- cgit v1.2.3