summaryrefslogtreecommitdiffstats
path: root/autoload/cargo.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2020-03-02 00:34:02 +0100
committerAdam Stankiewicz <sheerun@sher.pl>2020-03-02 00:34:02 +0100
commit6b540d7db030e4110aa3a31dd06c6c41387444db (patch)
tree1cd1da5b35cf1c34b38d7506ff93aabf861747bf /autoload/cargo.vim
parent35ea4d2b9072594b6c0ccf87bde7978ed9f94755 (diff)
downloadvim-polyglot-6b540d7db030e4110aa3a31dd06c6c41387444db.tar.gz
vim-polyglot-6b540d7db030e4110aa3a31dd06c6c41387444db.zip
Update
Diffstat (limited to '')
-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