Skip to content

Commit

Permalink
chore: improve inline diff widget render
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricbet committed Oct 16, 2024
1 parent 7d79b7e commit f26b3ac
Showing 1 changed file with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import { Autowired, INJECTOR_TOKEN, Injectable, Injector } from '@opensumi/di';
import { StackingLevel } from '@opensumi/ide-core-browser';
import { ActionSourceEnum, ActionTypeEnum, Disposable, Emitter, Event, IAIReporter } from '@opensumi/ide-core-common';
import {
ActionSourceEnum,
ActionTypeEnum,
Disposable,
Emitter,
Event,
IAIReporter,
runWhenIdle,
} from '@opensumi/ide-core-common';
import { ISingleEditOperation } from '@opensumi/ide-editor';
import { ICodeEditor, IEditorDecorationsCollection, ITextModel, Position, Range } from '@opensumi/ide-monaco';
import { StandaloneServices } from '@opensumi/ide-monaco/lib/browser/monaco-api/services';
Expand Down Expand Up @@ -668,10 +676,11 @@ export class LivePreviewDiffDecorationModel extends Disposable {
}

public touchRemovedWidget(states: IRemovedWidgetState[]) {
this.clearRemovedWidgets();

states.forEach(({ textLines, position }) => {
this.showRemovedWidgetByLineNumber(position.lineNumber, textLines, {});
runWhenIdle(() => {
this.clearRemovedWidgets();
states.forEach(({ textLines, position }) => {
this.showRemovedWidgetByLineNumber(position.lineNumber, textLines, {});
});
});
}

Expand Down

0 comments on commit f26b3ac

Please sign in to comment.