mirror of
https://github.com/amix/vimrc
synced 2025-07-07 00:15:00 +08:00
Updated plugins
This commit is contained in:
@ -3,7 +3,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
|
||||
|
@ -1,4 +1,3 @@
|
||||
" Author: Kevin Ballard
|
||||
" Description: Helper functions for Rust commands/mappings
|
||||
" Last Modified: May 27, 2014
|
||||
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
|
||||
@ -508,16 +507,23 @@ function! s:SearchTestFunctionNameUnderCursor() abort
|
||||
return matchstr(getline(test_func_line), '\m\C^\s*fn\s\+\zs\h\w*')
|
||||
endfunction
|
||||
|
||||
function! rust#Test(all, options) abort
|
||||
function! rust#Test(mods, winsize, all, options) abort
|
||||
let manifest = findfile('Cargo.toml', expand('%:p:h') . ';')
|
||||
if manifest ==# ''
|
||||
return rust#Run(1, '--test ' . a:options)
|
||||
endif
|
||||
|
||||
" <count> defaults to 0, but we prefer an empty string
|
||||
let winsize = a:winsize ? a:winsize : ''
|
||||
|
||||
if has('terminal')
|
||||
let cmd = 'terminal '
|
||||
if has('patch-8.0.910')
|
||||
let cmd = printf('%s noautocmd %snew | terminal ++curwin ', a:mods, winsize)
|
||||
else
|
||||
let cmd = printf('%s terminal ', a:mods)
|
||||
endif
|
||||
elseif has('nvim')
|
||||
let cmd = 'noautocmd new | terminal '
|
||||
let cmd = printf('%s noautocmd %snew | terminal ', a:mods, winsize)
|
||||
else
|
||||
let cmd = '!'
|
||||
let manifest = shellescape(manifest)
|
||||
|
Reference in New Issue
Block a user