@@ -122,11 +122,15 @@ func WaitFor(expr)
122122endfunc
123123
124124" 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.
125+ " "before" is a list of Vim commands to be executed before loading plugins.
126+ " "after" is a list of Vim commands to be executed after loading plugins.
127127" Plugins are not loaded, unless 'loadplugins' is set in "before".
128128" Return 1 if Vim could be executed.
129129func RunVim (before, after, arguments)
130+ call RunVimPiped (a: before , a: after , a: arguments , ' ' )
131+ endfunc
132+
133+ func RunVimPiped (before, after, arguments, pipecmd)
130134 if ! filereadable (' vimcmd' )
131135 return 0
132136 endif
@@ -145,7 +149,13 @@ func RunVim(before, after, arguments)
145149 if cmd !~ ' -u NONE'
146150 let cmd = cmd . ' -u NONE'
147151 endif
148- exe " silent !" . cmd . args . ' ' . a: arguments
152+
153+ " With pipecmd we can't set VIMRUNTIME.
154+ if a: pipecmd != ' '
155+ let cmd = substitute (cmd, ' VIMRUNTIME=.*VIMRUNTIME;' , ' ' , ' ' )
156+ endif
157+
158+ exe " silent !" . a: pipecmd . cmd . args . ' ' . a: arguments
149159
150160 if len (a: before ) > 0
151161 call delete (' Xbefore.vim' )
0 commit comments