We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c04ae84 commit 70bd1e3Copy full SHA for 70bd1e3
autoload/cargo.vim
@@ -3,7 +3,17 @@ function! cargo#Load()
3
endfunction
4
5
function! cargo#cmd(args)
6
- execute "! cargo" a:args
+ " Trim trailing spaces. This is necessary since :terminal command parses
7
+ " trailing spaces as an empty argument.
8
+ let args = substitute(a:args, '\s\+$', '', '')
9
+ if has('terminal')
10
+ let cmd = 'terminal'
11
+ elseif has('nvim')
12
+ let cmd = 'noautocmd new | terminal'
13
+ else
14
+ let cmd = '!'
15
+ endif
16
+ execute cmd 'cargo' args
17
18
19
function! s:nearest_cargo(...) abort
0 commit comments