diff options
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/rust.vim | 2 | ||||
-rw-r--r-- | autoload/rustfmt.vim | 8 |
2 files changed, 7 insertions, 3 deletions
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 |