mirror of
https://github.com/amix/vimrc
synced 2025-07-06 16:05:01 +08:00
Updated plugins
This commit is contained in:
@ -1,12 +1,14 @@
|
||||
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'
|
||||
@ -98,6 +100,22 @@ function! cargo#bench(args)
|
||||
call cargo#cmd("bench " . a:args)
|
||||
endfunction
|
||||
|
||||
function! cargo#update(args)
|
||||
call cargo#cmd("update " . a:args)
|
||||
endfunction
|
||||
|
||||
function! cargo#search(args)
|
||||
call cargo#cmd("search " . a:args)
|
||||
endfunction
|
||||
|
||||
function! cargo#publish(args)
|
||||
call cargo#cmd("publish " . a:args)
|
||||
endfunction
|
||||
|
||||
function! cargo#install(args)
|
||||
call cargo#cmd("install " . a:args)
|
||||
endfunction
|
||||
|
||||
function! cargo#runtarget(args)
|
||||
let l:filename = expand('%:p')
|
||||
let l:read_manifest = system('cargo read-manifest')
|
||||
|
@ -499,7 +499,15 @@ function! s:SearchTestFunctionNameUnderCursor() abort
|
||||
|
||||
" Search the end of test function (closing brace) to ensure that the
|
||||
" cursor position is within function definition
|
||||
normal! %
|
||||
if maparg('<Plug>(MatchitNormalForward)') ==# ''
|
||||
keepjumps normal! %
|
||||
else
|
||||
" Prefer matchit.vim official plugin to native % since the plugin
|
||||
" provides better behavior than original % (#391)
|
||||
" To load the plugin, run:
|
||||
" :packadd matchit
|
||||
execute 'keepjumps' 'normal' "\<Plug>(MatchitNormalForward)"
|
||||
endif
|
||||
if line('.') < cursor_line
|
||||
return ''
|
||||
endif
|
||||
@ -541,21 +549,20 @@ function! rust#Test(mods, winsize, all, options) abort
|
||||
let saved = getpos('.')
|
||||
try
|
||||
let func_name = s:SearchTestFunctionNameUnderCursor()
|
||||
if func_name ==# ''
|
||||
echohl ErrorMsg
|
||||
echomsg 'No test function was found under the cursor. Please add ! to command if you want to run all tests'
|
||||
echohl None
|
||||
return
|
||||
endif
|
||||
if a:options ==# ''
|
||||
execute cmd . 'cargo test --manifest-path' manifest func_name
|
||||
else
|
||||
execute cmd . 'cargo test --manifest-path' manifest func_name a:options
|
||||
endif
|
||||
return
|
||||
finally
|
||||
call setpos('.', saved)
|
||||
endtry
|
||||
if func_name ==# ''
|
||||
echohl ErrorMsg
|
||||
echomsg 'No test function was found under the cursor. Please add ! to command if you want to run all tests'
|
||||
echohl None
|
||||
return
|
||||
endif
|
||||
if a:options ==# ''
|
||||
execute cmd . 'cargo test --manifest-path' manifest func_name
|
||||
else
|
||||
execute cmd . 'cargo test --manifest-path' manifest func_name a:options
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
|
Reference in New Issue
Block a user