mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 17:19:48 +01:00
the margins are not set when not an initial render
This commit is contained in:
@@ -203,7 +203,11 @@ export class InlineChatController implements IEditorContribution {
|
||||
} else {
|
||||
widgetPosition = this._strategy.getWidgetPosition();
|
||||
}
|
||||
this._zone.value.show((widgetPosition ?? this._zone.value.position) ?? this._activeSession.wholeRange.value.getEndPosition());
|
||||
const position = ((widgetPosition ?? this._zone.value.position) ?? this._activeSession.wholeRange.value.getEndPosition());
|
||||
this._zone.value.show(position);
|
||||
if (initialRender) {
|
||||
this._zone.value.setMargins(position);
|
||||
}
|
||||
}
|
||||
|
||||
protected async _nextState(state: State, options: InlineChatRunOptions | undefined): Promise<void> {
|
||||
|
||||
@@ -795,10 +795,9 @@ export class InlineChatZoneWidget extends ZoneWidget {
|
||||
super.show(position, this._computeHeightInLines());
|
||||
this.widget.focus();
|
||||
this._ctxVisible.set(true);
|
||||
this._setMargins(position);
|
||||
}
|
||||
|
||||
private _setMargins(position: Position): void {
|
||||
public setMargins(position: Position): void {
|
||||
const viewModel = this.editor._getViewModel();
|
||||
if (!viewModel) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user