microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.26k stars 29.3k forks source link

Running a cell affects (and doubles) the undo stack #117945

Open eamodio opened 3 years ago

eamodio commented 3 years ago

In this Gif, I pressed undo 8 times (since I ran the cell 4 times) to get back to the actual editor undo. You can see the counter in [] update for each undo stop.

notebook

rebornix commented 3 years ago

This is a typical thing to happen but we should explore how to improve it

For every edit, kernel applies workspace edit, which will introduce a unique undo point, which makes undo hard as users have to go through every change, even if it's invisible or less-noticeable.

rebornix commented 1 year ago

Execution state is now out of metadata so we will have fewer undo/redo points. However users might still have multiple undo/redo points as there might be multiple cell model updates within one single execution. Maybe we could consider merging all of them before execution finishes. Leaving it to @roblourens .

roblourens commented 1 year ago

Model updates for what? Output updates won't be undoable