Skip to content

Commit 653e8d0

Browse files
committed
placing the update backrgound elsewhere
1 parent ee3b543 commit 653e8d0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,23 +196,23 @@ export class InlineChatController implements IEditorContribution {
196196

197197
private _showWidget(initialRender: boolean = false) {
198198
assertType(this._editor.hasModel());
199-
assertType(this._activeSession);
200199

201200
let widgetPosition: Position;
202201
if (initialRender) {
203202
widgetPosition = this._editor.getSelection().getEndPosition();
204203
this._zone.value.setContainerMargins();
205204
this._zone.value.setWidgetMargins(widgetPosition);
206205
} else {
206+
assertType(this._activeSession);
207207
assertType(this._strategy);
208208
widgetPosition = this._strategy.getWidgetPosition() ?? this._zone.value.position ?? this._activeSession.wholeRange.value.getEndPosition();
209209
const needsMargin = this._strategy.needsMargin();
210210
if (!needsMargin) {
211211
this._zone.value.setWidgetMargins(widgetPosition, 0);
212212
}
213+
this._zone.value.updateBackgroundColor(widgetPosition, this._activeSession.wholeRange.value);
213214
}
214215
this._zone.value.show(widgetPosition);
215-
this._zone.value.updateBackgroundColor(widgetPosition, this._activeSession.wholeRange.value);
216216
}
217217

218218
protected async _nextState(state: State, options: InlineChatRunOptions): Promise<void> {

0 commit comments

Comments
 (0)