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/rust | |
| parent | 15aeea662e0b08088ac7b6e3ee661c834e69106a (diff) | |
| download | vim-polyglot-7a0f2d974f9ac5bc85607e8c769d3370dd18ac74.tar.gz vim-polyglot-7a0f2d974f9ac5bc85607e8c769d3370dd18ac74.zip  | |
Updatev4.1.2
Diffstat (limited to '')
| -rw-r--r-- | autoload/rust.vim | 14 | 
1 files changed, 10 insertions, 4 deletions
diff --git a/autoload/rust.vim b/autoload/rust.vim index 658b90cc..8bb2b126 100644 --- a/autoload/rust.vim +++ b/autoload/rust.vim @@ -1,6 +1,5 @@  if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1 -" 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 @@ -510,16 +509,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)  | 
