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

BUG: Arrow keys navigation causes double cell hops #77

Merged
merged 4 commits into from
Mar 12, 2023

Conversation

alexveden
Copy link
Contributor

@alexveden alexveden commented Feb 8, 2023

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
Copy link

github-actions bot commented Feb 8, 2023

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

Copy link
Collaborator

@krassowski krassowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @alexveden! I was able to reproduce the problem and verified this patch locally.

@krassowski krassowski merged commit 16aa2b5 into jupyterlab-contrib:master Mar 12, 2023
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

Successfully merging this pull request may close these issues.

2 participants