diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2019-12-07 12:21:37 +0100 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2019-12-07 12:21:37 +0100 |
commit | 7a0f2d974f9ac5bc85607e8c769d3370dd18ac74 (patch) | |
tree | 5c2b955af8e0f2ed54442d9e938fad403148ffce /autoload/cargo.vim | |
parent | 15aeea662e0b08088ac7b6e3ee661c834e69106a (diff) | |
download | vim-polyglot-4.1.2.tar.gz vim-polyglot-4.1.2.zip |
Updatev4.1.2
Diffstat (limited to 'autoload/cargo.vim')
-rw-r--r-- | autoload/cargo.vim | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/autoload/cargo.vim b/autoload/cargo.vim index f24db923..ffa946da 100644 --- a/autoload/cargo.vim +++ b/autoload/cargo.vim @@ -5,7 +5,17 @@ function! cargo#Load() endfunction function! cargo#cmd(args) - execute "! cargo" a:args + " 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') + let cmd = 'terminal' + elseif has('nvim') + let cmd = 'noautocmd new | terminal' + else + let cmd = '!' + endif + execute cmd 'cargo' args endfunction function! s:nearest_cargo(...) abort |