diff options
| author | Daniel Hahler <git@thequod.de> | 2019-08-13 22:16:41 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-13 22:16:41 +0200 |
| commit | c649e18131acce55e4e6cab251517dd6543bc04c (patch) | |
| tree | 0546bc19489d05217adcb16ed1e3ceca96513e4e /src/nvim/testdir/shared.vim | |
| parent | 947bd293c98eda680c0e89b2d453b91eeda54272 (diff) | |
| parent | db41d02e48d9391f7f4ea944e27a46af05731822 (diff) | |
| download | rneovim-c649e18131acce55e4e6cab251517dd6543bc04c.tar.gz rneovim-c649e18131acce55e4e6cab251517dd6543bc04c.tar.bz2 rneovim-c649e18131acce55e4e6cab251517dd6543bc04c.zip | |
Merge pull request #10752 from blueyed/vim-8.0.1179
Diffstat (limited to 'src/nvim/testdir/shared.vim')
| -rw-r--r-- | src/nvim/testdir/shared.vim | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/nvim/testdir/shared.vim b/src/nvim/testdir/shared.vim index 6cc2d06a36..ab0a4fd706 100644 --- a/src/nvim/testdir/shared.vim +++ b/src/nvim/testdir/shared.vim @@ -196,16 +196,26 @@ func s:feedkeys(timer) call feedkeys('x', 'nt') endfunc +" Get $VIMPROG to run Vim executable. +" The Makefile writes it as the first line in the "vimcmd" file. +" Nvim: uses $NVIM_TEST_ARG0. +func GetVimProg() + if empty($NVIM_TEST_ARG0) + " Assume the script was sourced instead of running "make". + return '../../../build/bin/nvim' + endif + return $NVIM_TEST_ARG0 +endfunc + " Get the command to run Vim, with -u NONE and --headless arguments. " If there is an argument use it instead of "NONE". -" Returns an empty string on error. func GetVimCommand(...) if a:0 == 0 let name = 'NONE' else let name = a:1 endif - let cmd = v:progpath + let cmd = GetVimProg() let cmd = substitute(cmd, '-u \f\+', '-u ' . name, '') if cmd !~ '-u '. name let cmd = cmd . ' -u ' . name @@ -215,6 +225,14 @@ func GetVimCommand(...) return cmd endfunc +" Get the command to run Vim, with --clean. +func GetVimCommandClean() + let cmd = GetVimCommand() + let cmd = substitute(cmd, '-u NONE', '--clean', '') + let cmd = substitute(cmd, '--headless', '', '') + return cmd +endfunc + " Run Vim, using the "vimcmd" file and "-u NORC". " "before" is a list of Vim commands to be executed before loading plugins. " "after" is a list of Vim commands to be executed after loading plugins. |