comparison src/testdir/shared.vim @ 9778:4360b2b46125 v7.4.2164

commit https://github.com/vim/vim/commit/66459b7c98c67f8a9d39de8f08e8e8f1fca0e359 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Aug 6 19:01:55 2016 +0200 patch 7.4.2164 Problem: It is not possible to use plugins in an "after" directory to tune the behavior of a package. Solution: First load plugins from non-after directories, then packages and finally plugins in after directories. Reset 'loadplugins' before executing --cmd arguments.
author Christian Brabandt <cb@256bit.org>
date Sat, 06 Aug 2016 19:15:06 +0200
parents 9f8f03a44886
children 3fdf6caf42f7
comparison
equal deleted inserted replaced
9777:cbd2d046575d 9778:4360b2b46125
118 catch 118 catch
119 endtry 119 endtry
120 sleep 10m 120 sleep 10m
121 endfor 121 endfor
122 endfunc 122 endfunc
123
124 " Run Vim, using the "vimcmd" file and "-u NORC".
125 " "before" is a list of commands to be executed before loading plugins.
126 " "after" is a list of commands to be executed after loading plugins.
127 " Plugins are not loaded, unless 'loadplugins' is set in "before".
128 " Return 1 if Vim could be executed.
129 func RunVim(before, after)
130 if !filereadable('vimcmd')
131 return 0
132 endif
133 call writefile(a:before, 'Xbefore.vim')
134 call writefile(a:after, 'Xafter.vim')
135
136 let cmd = readfile('vimcmd')[0]
137 let cmd = substitute(cmd, '-u \f\+', '-u NONE', '')
138 exe "silent !" . cmd . " --cmd 'so Xbefore.vim' -S Xafter.vim"
139
140 call delete('Xbefore.vim')
141 call delete('Xafter.vim')
142 return 1
143 endfunc