mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-09 16:24:45 +01:00
better undo experience (#176247)
This commit is contained in:
@@ -684,16 +684,16 @@ export class InteractiveEditorController implements IEditorContribution {
|
||||
options: InteractiveEditorController._decoBlock
|
||||
}]);
|
||||
|
||||
this._ctsRequest?.dispose(true);
|
||||
this._ctsRequest = new CancellationTokenSource(this._ctsSession.token);
|
||||
|
||||
this._historyOffset = -1;
|
||||
const input = await this._zone.getInput(wholeRange.getEndPosition(), placeholder, value, this._ctsSession.token);
|
||||
const input = await this._zone.getInput(wholeRange.getEndPosition(), placeholder, value, this._ctsRequest.token);
|
||||
|
||||
if (!input || !input.value) {
|
||||
continue;
|
||||
}
|
||||
|
||||
this._ctsRequest?.dispose(true);
|
||||
this._ctsRequest = new CancellationTokenSource(this._ctsSession.token);
|
||||
|
||||
const historyEntry = this._zone.widget.createHistoryEntry(input.value);
|
||||
|
||||
const sw = StopWatch.create();
|
||||
@@ -772,6 +772,7 @@ export class InteractiveEditorController implements IEditorContribution {
|
||||
|
||||
inlineDiffDecorations.set(input.preview ? newInlineDiffDecorationsData : []);
|
||||
|
||||
const that = this;
|
||||
historyEntry.updateActions([new class extends UndoStepAction {
|
||||
constructor() {
|
||||
super(textModel);
|
||||
@@ -780,10 +781,10 @@ export class InteractiveEditorController implements IEditorContribution {
|
||||
super.run();
|
||||
historyEntry.updateVisibility(false);
|
||||
value = input.value;
|
||||
that._ctsRequest?.cancel();
|
||||
}
|
||||
}]);
|
||||
|
||||
|
||||
if (!InteractiveEditorController._promptHistory.includes(input.value)) {
|
||||
InteractiveEditorController._promptHistory.unshift(input.value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user