jupyterlab-contrib / jupyterlab-vim

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

undo with `u` does not work on jupyterlab 4 #89

Closed navdeeprana closed 11 months ago

navdeeprana commented 11 months ago

Thank you so much for maintaining and porting the extension to jupyterlab 4. I upgraded to the latest versions of both and undo with u does not work. Ctrl-Z does.

lukashergt commented 11 months ago

I can confirm, u within a cell does not work.

In "jupyter" mode, you can create a new cell with o and undo that with u.

ianhi commented 11 months ago

Thanks for reporting! I can confirm that I experience this. I wonder if this is the same cause as https://github.com/jupyterlab-contrib/jupyterlab-vim/issues/31 where we were colliding with a default jupyter shortcut somehow.

It's not because we switched to the new codemirror vim as it's works here: https://replit.com/@util/codemirror-vim

ianhi commented 11 months ago

maybe related to https://github.com/jupyterlab/jupyterlab/issues/14113

ianhi commented 11 months ago

digging deeper still it seems that undo has become a more complicated action in jupyterlab 4. probably to help with the real time collab stuff. It seems as though ctrl-Z isn't handled by codemirror, but rather by jupyterlab. in particular I think it ends up calling this funciton: https://github.com/jupyterlab/jupyterlab/blob/659c6113a97cb906c8b90867a1fe916e628547f2/packages/codemirror/src/editor.ts#L263-L265

so we'll need to end up overriding what u does and have it call that funciton somehow

krassowski commented 11 months ago

That's doable. I can open a PR on top of #90.

krassowski commented 11 months ago

PR is up: https://github.com/jupyterlab-contrib/jupyterlab-vim/pull/92

ianhi commented 11 months ago

fix is now released.

pip install --upgrade jupyterlab-vim

navdeeprana commented 11 months ago

thank you so much for the quick fix