File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -200,8 +200,22 @@ def update_subchannel_msgs(debug=False):
200
200
b = vim .current.buffer
201
201
startedin_vimipython = (b .name is not None and b .name.endswith (' vim-ipython' ))
202
202
if not startedin_vimipython:
203
- vim .command (" pcl" )
204
- vim .command (" silent pedit vim-ipython" )
203
+ # switch to preview window
204
+ vim .command (
205
+ " try"
206
+ " |silent! wincmd P"
207
+ " |catch /^Vim\%((\a\+)\)\=:E441/"
208
+ " |silent pedit vim-ipython"
209
+ " |silent! wincmd P"
210
+ " |endtry")
211
+ # if the current window is called ' vim-ipython'
212
+ if vim .eval (' @%' )== ' vim-ipython' :
213
+ # set the preview window height to the current height
214
+ vim .command (" set pvh=" + vim .eval (' winheight(0)' ))
215
+ else :
216
+ # close preview window , it was something other than ' vim-ipython'
217
+ vim .command (" pcl" )
218
+ vim .command (" silent pedit vim-ipython" )
205
219
vim .command (" normal P" ) #switch to preview window
206
220
# subchannel window quick quit key ' q'
207
221
vim .command (' map <buffer> q :q<CR>' )
You can’t perform that action at this time.
0 commit comments