Skip to content

Commit cbbfe11

Browse files
authored
Merge pull request microsoft#185110 from microsoft/aiday/inlineChatEndOfSelection
Setting the position to the end position of the selection
2 parents d52fb41 + 16268ba commit cbbfe11

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ export class InlineChatController implements IEditorContribution {
201201

202202
let widgetPosition: Position | undefined;
203203
if (initialRender) {
204-
widgetPosition = this._editor.getPosition();
204+
widgetPosition = this._editor.getSelection().getEndPosition();
205205
this._zone.value.setMargins(widgetPosition);
206206
} else {
207207
widgetPosition = this._strategy.getWidgetPosition() ?? this._zone.value.position ?? this._activeSession.wholeRange.value.getEndPosition();

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,7 @@ export class InlineChatZoneWidget extends ZoneWidget {
825825
if (this._indentationWidth === indentationWidth) {
826826
return;
827827
}
828+
this._indentationWidth = indentationWidth;
828829
const info = this.editor.getLayoutInfo();
829830
const marginWithoutIndentation = info.glyphMarginWidth + info.decorationsWidth + info.lineNumbersWidth;
830831
const marginWithIndentation = marginWithoutIndentation + this._indentationWidth;

0 commit comments

Comments
 (0)