Skip to content

Commit

Permalink
silently switch buffers to preserve messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanov committed Aug 2, 2011
1 parent f5c138f commit d065b91
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
13 changes: 6 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ Now type out a line and send it to IPython using ``<Ctrl-S>`` from Command mode:
You should see a notification message confirming the line was sent, along
with the input number for the line, like so ``In[1]: import os``.

``<Ctrl-S>`` also works from insert mode, but doesn't show notification
``<Ctrl-S>`` also works from insert mode, but doesn't show notification,
unless ``monitor_subchannel`` is set to ``True`` (see `vim-ipython 'shell'`_,
below)

It also works blockwise in Visual Mode. Strip the leading double quotes and
send these lines using ``<Ctrl-S>``::
Expand Down Expand Up @@ -95,13 +97,13 @@ completion.
vim-ipython 'shell'
-------------------

*new since IPython 0.11*!
*NEW since IPython 0.11*!

By monitoring km.sub_channel, we can recreate what messages were sent to
IPython, and what IPython sends back in response.

``monitor_subchannel`` is a parameter that sets whether this 'shell' should
update on every sent command (default: True).
updated on every sent command (default: True).

If at any later time you wish to bring this shell up, including if you've set
``monitor_subchannel=False``, hit ``<leader>s``.
Expand All @@ -125,10 +127,7 @@ own file and do a lazy import (only when the IPython command is called)

The ipdb integration is not yet re-implemented.

Unicode support - if you have a unicode file and you type ls, vim has trouble
processing that message.

Also, I've seen other sporadic unicode related errors.
There were some unicode errors, but they should all be fixed now.

------
Thanks
Expand Down
6 changes: 3 additions & 3 deletions ftplugin/python/ipy.vim
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def get_doc_buffer(level=0):
#vim.command('pedit doc')
#vim.command('normal ') # go to previous window

def update_subchannel_msgs(debug=True):
def update_subchannel_msgs(debug=False):
msgs = km.sub_channel.get_msgs()
if debug:
#try:
Expand All @@ -166,7 +166,7 @@ def update_subchannel_msgs(debug=True):
else:
db = []
vim.command("pcl")
vim.command("pedit vim-ipython")
vim.command("silent pedit vim-ipython")
vim.command("normal P") #switch to preview window
# subchannel window quick quit key 'q'
vim.command('map <buffer> q :q<CR>')
Expand Down Expand Up @@ -210,7 +210,7 @@ def update_subchannel_msgs(debug=True):
encoding = vim.eval("&encoding")
b.append([l.encode(encoding) for l in s.splitlines()])
vim.command('normal G') # go to the end of the file
vim.command('e #|pedit vim-ipython')
vim.command('silent e #|silent pedit vim-ipython')

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

0 comments on commit d065b91

Please sign in to comment.