mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 18:19:12 +01:00
inline chat fixes (#233566)
* take decorationWidth into account when layouting chat zone https://github.com/microsoft/vscode/issues/233561 * chat - fix input height computation when resizing editor
This commit is contained in:
@@ -151,8 +151,10 @@ export class InlineChatZoneWidget extends ZoneWidget {
|
||||
|
||||
protected override _doLayout(heightInPixel: number): void {
|
||||
|
||||
this._updatePadding();
|
||||
|
||||
const info = this.editor.getLayoutInfo();
|
||||
let width = info.contentWidth + info.glyphMarginWidth - 8;
|
||||
let width = info.contentWidth - info.verticalScrollbarWidth;
|
||||
width = Math.min(850, width);
|
||||
|
||||
this._dimension = new Dimension(width, heightInPixel);
|
||||
@@ -190,9 +192,7 @@ export class InlineChatZoneWidget extends ZoneWidget {
|
||||
override show(position: Position): void {
|
||||
assertType(this.container);
|
||||
|
||||
const info = this.editor.getLayoutInfo();
|
||||
const marginWithoutIndentation = info.glyphMarginWidth + info.lineNumbersWidth;
|
||||
this.container.style.paddingLeft = `${marginWithoutIndentation}px`;
|
||||
this._updatePadding();
|
||||
|
||||
const revealZone = this._createZoneAndScrollRestoreFn(position);
|
||||
super.show(position, this._computeHeight().linesValue);
|
||||
@@ -203,6 +203,14 @@ export class InlineChatZoneWidget extends ZoneWidget {
|
||||
this._scrollUp.enable();
|
||||
}
|
||||
|
||||
private _updatePadding() {
|
||||
assertType(this.container);
|
||||
|
||||
const info = this.editor.getLayoutInfo();
|
||||
const marginWithoutIndentation = info.glyphMarginWidth + info.lineNumbersWidth + info.decorationsWidth;
|
||||
this.container.style.paddingLeft = `${marginWithoutIndentation}px`;
|
||||
}
|
||||
|
||||
reveal(position: Position) {
|
||||
const stickyScroll = this.editor.getOption(EditorOption.stickyScroll);
|
||||
const magicValue = stickyScroll.enabled ? stickyScroll.maxLineCount : 0;
|
||||
|
||||
Reference in New Issue
Block a user