mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-03 06:51:53 +01:00
no undoStops between streaming edits, esp not between last and second to last round (#196708)
fixes https://github.com/microsoft/vscode-copilot/issues/2403
This commit is contained in:
@@ -225,7 +225,6 @@ class InlineDiffDecorations {
|
||||
|
||||
export interface ProgressingEditsOptions {
|
||||
duration: number;
|
||||
round: number;
|
||||
token: CancellationToken;
|
||||
}
|
||||
|
||||
@@ -328,8 +327,9 @@ export class LiveStrategy extends EditModeStrategy {
|
||||
|
||||
override async makeProgressiveChanges(edits: ISingleEditOperation[], opts: ProgressingEditsOptions): Promise<void> {
|
||||
|
||||
if (opts.round === 0) {
|
||||
this._session.textModelN.pushStackElement();
|
||||
// push undo stop before first edit
|
||||
if (++this._editCount === 1) {
|
||||
this._editor.pushUndoStop();
|
||||
}
|
||||
|
||||
const durationInSec = opts.duration / 1000;
|
||||
@@ -591,14 +591,16 @@ export function asProgressiveEdit(edit: IIdentifiedSingleEditOperation, wordsPer
|
||||
if (r.isFullString) {
|
||||
clearInterval(handle);
|
||||
stream.resolve();
|
||||
d.dispose();
|
||||
}
|
||||
|
||||
}, 1000 / wordsPerSec);
|
||||
|
||||
// cancel ASAP
|
||||
token.onCancellationRequested(() => {
|
||||
const d = token.onCancellationRequested(() => {
|
||||
clearTimeout(handle);
|
||||
stream.resolve();
|
||||
d.dispose();
|
||||
});
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user