Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output in console buffer lets cursor jump in other buffers #13

Open
languitar opened this issue Jan 12, 2016 · 10 comments
Open

Output in console buffer lets cursor jump in other buffers #13

languitar opened this issue Jan 12, 2016 · 10 comments

Comments

@languitar
Copy link

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.

@bfredl
Copy link
Owner

bfredl commented Jan 13, 2016

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

@languitar
Copy link
Author

Steps to reproduce:

  1. start nvim with some python file
  2. :IPython
  3. Focus python file again
  4. C+w o so that the python file is the only visible one
  5. move cursor somewhere
  6. In a new shell: jupyter console --existing
  7. 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)

@bfredl
Copy link
Owner

bfredl commented Jan 14, 2016

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?

@languitar
Copy link
Author

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.

@bfredl
Copy link
Owner

bfredl commented Jan 15, 2016

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.

@languitar
Copy link
Author

file-optimized

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.

@bfredl
Copy link
Owner

bfredl commented Jan 20, 2016

Did you try with disabled append_outbuf as I suggested above?

@languitar
Copy link
Author

Without that the cursor does not jump.

@bfredl
Copy link
Owner

bfredl commented Jan 20, 2016

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?

@languitar
Copy link
Author

With these three lines removed the issue still exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants