Skip to content

Commit

Permalink
Stay in preview window when running code from there
Browse files Browse the repository at this point in the history
  • Loading branch information
zeekay committed Jan 19, 2012
1 parent fb18190 commit 4d32d66
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ftplugin/python/ipy.vim
Expand Up @@ -180,15 +180,17 @@ def get_doc_buffer(level=0):
vim.command('wincmd p')

def update_subchannel_msgs(debug=False):
msgs = km.sub_channel.get_msgs()
startedin_vimipython = vim.eval('@%') == 'vim-ipython'

vim.command('silent pcl')
vim.command('botright 10 new vim-ipython')
vim.command('setlocal modifiable noro')
# subchannel window quick quit key 'q'
vim.command('map <buffer> q :q<CR>')

b = vim.current.buffer
for m in msgs:

for m in km.sub_channel.get_msgs():
s = ''
if 'msg_type' not in m['header']:
# debug information
Expand Down Expand Up @@ -236,8 +238,9 @@ def update_subchannel_msgs(debug=False):
vim.command("set bufhidden=hide buftype=nofile ft=python")
# indicate the output window as the current previewwindow
vim.command('setlocal previewwindow nomodified')
# return from whence you came
vim.command('wincmd p')
if not startedin_vimipython:
# return from whence you came
vim.command('wincmd p')

def get_child_msg(msg_id):
# XXX: message handling should be split into its own process in the future
Expand Down

0 comments on commit 4d32d66

Please sign in to comment.