File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -170,9 +170,11 @@ def update_subchannel_msgs(debug=False):
170
170
db = vim .current.buffer
171
171
else :
172
172
db = []
173
- vim .command (" pcl" )
174
- vim .command (" silent pedit vim-ipython" )
175
- vim .command (" normal P" ) #switch to preview window
173
+ startedin_vimipython = vim .current.buffer .name.endswith (' vim-ipython' )
174
+ if not startedin_vimipython:
175
+ vim .command (" pcl" )
176
+ vim .command (" silent pedit vim-ipython" )
177
+ vim .command (" normal P" ) #switch to preview window
176
178
# subchannel window quick quit key ' q'
177
179
vim .command (' map <buffer> q :q<CR>' )
178
180
vim .command (" set bufhidden=hide buftype=nofile ft=python" )
@@ -219,7 +221,8 @@ def update_subchannel_msgs(debug=False):
219
221
except:
220
222
b .append ([l .encode (vim_encoding) for l in s .splitlines ()])
221
223
vim .command (' normal G' ) # go to the end of the file
222
- vim .command (' silent e #|silent pedit vim-ipython' )
224
+ if not startedin_vimipython:
225
+ vim .command (' normal p' ) # go back to where you were
223
226
224
227
def get_child_msg (msg_id):
225
228
# XXX : message handling should be split into its own process in the future
@@ -254,7 +257,6 @@ def with_subchannel(f):
254
257
f ()
255
258
if monitor_subchannel:
256
259
update_subchannel_msgs ()
257
- vim .command (' normal p' ) # go back to where you were
258
260
except AttributeError: #if km is None
259
261
echo (" not connected to IPython" , ' Error' )
260
262
return f_with_update
You can’t perform that action at this time.
0 commit comments