jupyterlab-contrib / jupyterlab-vim

Vim notebook cell bindings for JupyterLab
https://jupyterlab-contrib.github.io/jupyterlab-vim.html
MIT License
691 stars 43 forks source link

BUG: Arrow keys navigation causes double cell hops #77

Closed alexveden closed 1 year ago

alexveden commented 1 year ago

Arrow navigation was handled improperly, in vim normal mode pressing UpArrow/DnArrow lead to double cell hops.

How to reproduce: Add some arbitrary cells (multiline, single line, markdowns) and try to navigate with arrows instead of J/K. Sometimes you'll get double cell hop

I manually tested the following cases:

  1. Multiline code cell
  2. Empty /single line code cell
  3. Move up from the middle of the top line
  4. Move down from the middle of the last line
  5. Move up from first char of the code cell
  6. Move down from the last char of the code cell
  7. Repeated action from the middle of the cell (i.e. 6 , 7 combination)
  8. Markdown handling worked weird, probably because arrow keys change the active cell value before it got to the Vim handler. So I decided to keep markdown cell as code until explicit Shift+Ctrl. This is close to original Jupyter behavior and probably should be fine.
github-actions[bot] commented 1 year ago

Binder :point_left: Launch a binder notebook on branch alexveden/jupyterlab-vim/master