-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
fix for #1678, undo no longer clears cells #1965
Conversation
I found another bug where switching the cell type causes the loss of all undo history for that cell. With this commit, switching the cell type simply resets the history
What's the difference between losing and resetting the history? |
In the notebook, when a CodeMirror cell is initiated, it's text |
ok, thanks. |
sorry about the confusing wording, if a cell had contents changed from |
Is there any case where calling 'set_text' shouldn't do this? I'm wondering if that's where this call belongs. |
If that's not true, then I'm fine merging as-is, and we can worry about consolidation later. |
yes. Merging or splitting a cell also uses
I can also imagine downstream widgets using this function, the effects of which would then be |
gotcha, merging as-is then. |
fix for ipython#1678, undo no longer clears cells With these changes, Ctrl-Z inside of codemirror cells will only undo up to the text that was in the cell when it was loaded from JSON. closes ipython#1678
With these changes,
Ctrl-Z
inside of codemirror cells will only undo up to the text that was in the cell when it was loaded from JSON. This fixes #1678.I found another bug where switching the cell type causes the loss of all
undo history for that cell. With this commit, switching the cell type
simply resets the history to whatever it was at the time of the cell type switch.
For example, if a cell had contents changed from
X -> Y -> Z
, and then you change the cell type, before this commit, its history becomesØ -> Z
(where Ø is just empty), so pressingCtrl-Z
once in a changed cell just erases all of it's contents. After this commit, the new cell's history just gets reset toZ