-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Paste should have a separate undo event (3.1 regression) #10928
Comments
During the lab meeting, we discussed the capture timeout on the undo manager and decided to use the default (500ms); since that's what most editors do. But make it configurable to allow undoing character by character. As most editors do, Yjs keeps stacking inputs in the undo manager until the user stops writing for 500ms, then groups all the inputs as one undoable action. For the shared model, the paste action is just another input. Maybe we could detect a paste action by checking the input length, but I'm not sure if that would affect other input actions. |
In CodeMirror the
Sorry I could not attend. I am not convinced by the argumentation if it is based only on Google Docs as previously mentioned. For one, google docs does not have autocompletion (I think), then it also has auto-correction (which we do not have as we are not operating over a limited alphabet - variable names can be arbitrary).
Can we make the timeout configurable, so that 0 = character by character, and then the user could set it to 200 if they type fast or 800 if they type slow? |
That could be really useful. Thanks!!
No, it is not based on Google docs only. During the meeting, some people tried multiple editors and text areas on browsers, all of which do the same.
I think we can, but I need to try. |
…#11475) Co-authored-by: Kevin Jahns <[email protected]>
Description
Since JupyterLab 3.1 the history aggregation leads to the undo event often removing way too much code. In particular, uno after paste event, often remove text written prior to undo event, which is quite annoying when trying to correct text written prior to paste.
Reproduce
JupyterLab 3.0:
JupyterLab 3.1:
Expected behavior
As in JupyterLab 3.0; paste should always be a history event of its own that can be undone irrespective of previous changes.
Context
The text was updated successfully, but these errors were encountered: