Skip to content

Commit

Permalink
history - adopt code property of stack elements
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero committed Mar 16, 2022
1 parent e4b1a9e commit 60541eb
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ export class WorkingCopyHistoryTracker extends Disposable implements IWorkbenchC
private resolveSourceFromUndoRedo(e: IWorkingCopySaveEvent): SaveSource | undefined {
const lastStackElement = this.undoRedoService.getLastElement(e.workingCopy.resource);
if (lastStackElement) {
return lastStackElement.label !== 'Typing' ? lastStackElement.label : undefined; // TODO@bpasero do not hardcode this label
if (lastStackElement.code === 'undoredo.textBufferEdit') {
return undefined; // ignore any unspecific stack element that resulted just from typing
}

return lastStackElement.label;
}

const allStackElements = this.undoRedoService.getElements(e.workingCopy.resource);
Expand Down

0 comments on commit 60541eb

Please sign in to comment.