Skip to content

Commit d85ee0f

Browse files
committed
the margins are not set when not an initial render
1 parent eb98edb commit d85ee0f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,11 @@ export class InlineChatController implements IEditorContribution {
203203
} else {
204204
widgetPosition = this._strategy.getWidgetPosition();
205205
}
206-
this._zone.value.show((widgetPosition ?? this._zone.value.position) ?? this._activeSession.wholeRange.value.getEndPosition());
206+
const position = ((widgetPosition ?? this._zone.value.position) ?? this._activeSession.wholeRange.value.getEndPosition());
207+
this._zone.value.show(position);
208+
if (initialRender) {
209+
this._zone.value.setMargins(position);
210+
}
207211
}
208212

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

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -795,10 +795,9 @@ export class InlineChatZoneWidget extends ZoneWidget {
795795
super.show(position, this._computeHeightInLines());
796796
this.widget.focus();
797797
this._ctxVisible.set(true);
798-
this._setMargins(position);
799798
}
800799

801-
private _setMargins(position: Position): void {
800+
public setMargins(position: Position): void {
802801
const viewModel = this.editor._getViewModel();
803802
if (!viewModel) {
804803
return;

0 commit comments

Comments
 (0)