-
Notifications
You must be signed in to change notification settings - Fork 34.4k
Closed
Labels
feature-requestRequest for new features or functionalityRequest for new features or functionalitynotebookon-testplanundo-redoIssues around undo/redoIssues around undo/redo
Milestone
Description
Issue Type: Feature Request
Notebook is a resource which contains multiple text models so it leads to interesting requirements for workspace Undo/Redo. Right now there are three major scenarios
- Users are editing the content of a cell (focus is now in a monaco editor), Undo/Redo should work inside this editor. We already have this support.
- Users add/delete a cell, Undo/Redo should remove/re-add cells. We can archive this by
undoRedoService.pushElement(resource)
and the resource passed in is the resource uri of the notebook document - 🔴 Users do find & replace all on the notebook document. The change is a
WorkspaceEdit
and Undo/Redo is not working properly- We use
BulkEditService
to apply theWorksapceEdit
.WorkspaceEdit
consists of edits for multiple cells, which are allTextModel
s. - To Undo/Redo the
WorkspaceEdit
, we have to focus the text editor for the first modified cell of theWorkspaceEdit
. However, we want to allow Undo/Redo when the focus is not in any text editor.
- We use
I'm wondering if we can add something like undoRedoAllowedResources
property to the IWorkspaceUndoRedoElement
, thus in the notebook case, it will always be [notebookUri, firstModifiedCellUri]
.
export interface IWorkspaceUndoRedoElement {
readonly type: UndoRedoElementType.Workspace;
readonly resources: readonly URI[];
+ readonly undoRedoAllowedResources: URI[];
readonly label: string;
undo(): Promise<void> | void;
redo(): Promise<void> | void;
split(): IResourceUndoRedoElement[];
}
cc @mjbvz
VS Code version: Code - Insiders 1.44.0-insider (798481c, 2020-03-16T07:10:59.884Z)
OS version: Darwin x64 19.2.0
Metadata
Metadata
Assignees
Labels
feature-requestRequest for new features or functionalityRequest for new features or functionalitynotebookon-testplanundo-redoIssues around undo/redoIssues around undo/redo