summaryrefslogtreecommitdiffstats
path: root/autoload/cargo.vim
diff options
context:
space:
mode:
Diffstat (limited to 'autoload/cargo.vim')
-rw-r--r--autoload/cargo.vim12
1 files changed, 9 insertions, 3 deletions
diff --git a/autoload/cargo.vim b/autoload/cargo.vim
index ffa946da..fefd28de 100644
--- a/autoload/cargo.vim
+++ b/autoload/cargo.vim
@@ -1,14 +1,16 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
-function! cargo#Load()
+function! cargo#Load()
" Utility call to get this script loaded, for debugging
endfunction
-function! cargo#cmd(args)
+function! cargo#cmd(args) abort
" Trim trailing spaces. This is necessary since :terminal command parses
" trailing spaces as an empty argument.
let args = substitute(a:args, '\s\+$', '', '')
- if has('terminal')
+ if exists('g:cargo_shell_command_runner')
+ let cmd = g:cargo_shell_command_runner
+ elseif has('terminal')
let cmd = 'terminal'
elseif has('nvim')
let cmd = 'noautocmd new | terminal'
@@ -67,6 +69,10 @@ function! cargo#build(args)
call cargo#cmd("build " . a:args)
endfunction
+function! cargo#check(args)
+ call cargo#cmd("check " . a:args)
+endfunction
+
function! cargo#clean(args)
call cargo#cmd("clean " . a:args)
endfunction