Output in console buffer lets cursor jump in other buffers
If I produce output inside the ipython/jupyter kernel buffer, the cursor in another buffers jumps somewhere, even if the jupyter buffer isn't visible.
Cannot reproduce. Do you have more complete steps to reproduce? Btw the code that moves the cursor is
for w in self.vim.windows:
if w.buffer == self.buf:
w.cursor = [len(self.buf), int(1e9)]
which should only move the cursor in the jupyter buffer. But this reminds me this should be made dynamically configurable, which should be easy now that we have neovim/neovim#3603
Steps to reproduce:
- start
nvimwith some python file -
:IPython - Focus python file again
-
C+w oso that the python file is the only visible one - move cursor somewhere
- In a new shell:
jupyter console --existing - In that shell, enter some python code, e.g.
2+3
Cursor in vim moves to first line in the python file
NVIM v0.1.1-165-g074d3dc (compiled Jan 4 2016 11:10:24)
I cannot reproduce on bf7bc4dcf (master 18 hours ago). It could possible that the startup is racy with some autocommands or something. Could you try with minimal nvimrc with only this plugin?
This also happens with this minimal config: https://github.com/languitar/config-vim/tree/nvim-ipy-bug
The important part seems to be that this only happens if the ipython buffer is not shown in a window.
hmm weird, and always moves to the first line, even if you do it many times? Just for debugging try add return as the first line in append_outbuf in rplugin/python/nvim_ipy.py and see if still happens.

Here is a badly made screencast showing what I experience. It seems this only happens the first time the ipython buffers gets to the background.
Did you try with disabled append_outbuf as I suggested above?
Without that the cursor does not jump.
If you just remove this part
for w in self.vim.windows:
if w.buffer == self.buf:
w.cursor = [len(self.buf), int(1e9)]
does it still happen?
With these three lines removed the issue still exists.