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

Undo/redo does not scroll to selection #240

Open
krassowski opened this issue Jun 18, 2024 · 3 comments
Open

Undo/redo does not scroll to selection #240

krassowski opened this issue Jun 18, 2024 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@krassowski
Copy link
Collaborator

krassowski commented Jun 18, 2024

Description

This is one of the most frustrating things for me when using JupyterLab and it prevents me from working productively with larger files - see jupyterlab/jupyterlab#15102

Reproduce

See jupyterlab/jupyterlab#15102

Expected behavior

Editor scrolls on undo/redo if the new selection is outside of the viewport.

Context

This was just fixed in y-codemirror.next: yjs/y-codemirror.next#34 but jupyter_ydoc does not use that and has its own integration of undo manager.

@krassowski krassowski added the bug Something isn't working label Jun 18, 2024
@krassowski
Copy link
Collaborator Author

It looks like we need something like this._undoManager.on('stack-item-popped', this._onStackItemPopped). For now I would propose to add it for text documents as in notebooks the behaviour is more complex.

Then, I wonder how is selection set currently if _onStackItemPopped is not implemented?

@krassowski
Copy link
Collaborator Author

This is one of the most frustrating things for me when using JupyterLab and it prevents me from working productively with larger files

Well, I'm not alone: https://stackoverflow.com/questions/78818736/follow-changes-with-the-mouse-cursor-when-pressing-ctrl-z-z-undo-redo-in-jup

@krassowski
Copy link
Collaborator Author

I do not have rights to tag issues here, but if I could I would tag it with help wanted Extra attention is needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants