nvim-ipy icon indicating copy to clipboard operation
nvim-ipy copied to clipboard

Cursor jumps to the bottom line

Open spring-haru opened this issue 6 years ago • 3 comments

I've just started using nvim-ipy, which is great for me compared with other similar plugins, except one problem I encounter. In a .py file, cells are created using ##. But, the cursor always jumps to the bottom line if I run one of the following

<Plug>(IPy-Run)
<Plug>(IPy-RunCell)
<Plug>(IPy-RunAll)

The problem remains even if I add the following to init.vim.

let g:ipy_celldef = '^##'

NVIM v0.4.2 macOS 10.14.16

[Edit]

  • If I run <Plug>(IPy-RunCell), only a relevant cell is executed as expected.
  • I expected that the cursor stays or moves to the next cell after executing <Plug>(IPy-RunCell).

spring-haru avatar Oct 02 '19 05:10 spring-haru

nvim-ipy is now working fine.

nmap <C-c><C-v> <Plug>(IPy-RunCell)

executes a cell and does not move the cursor. I use

nnoremap <C-c><C-c> :execute "normal \<Plug>(IPy-RunCell)"<CR> <ESC> /^##<CR> :noh<CR>

to execute a cell and move to the next one.

spring-haru avatar Oct 03 '19 08:10 spring-haru

But, the cursor always jumps to the bottom line if I run one of the following

This sounds like an issue with previous neovim versions. Are you using the latest (0.4.2)?

bfredl avatar Oct 03 '19 13:10 bfredl

I use Neovim 0.4.2. Two pieces of info which might be relevant:

  • Yesterday the problem (the cursor jumps to the last line) disappeared apparently for no reason. This morning I rebooted Mac, and everything seems fine. (Hope things remain as they are.)
  • The following code worked fine (i.e. the cursor did not jump) even BEFORE the problem disappeared:
nnoremap <C-c><C-c> :execute "normal \<Plug>(IPy-RunCell)"<CR>

This suggests that setting map might have caused the problem.

spring-haru avatar Oct 03 '19 23:10 spring-haru