mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Improvements to notebook editor code auto height (#5291)
This commit is contained in:
committed by
Kevin Cunnane
parent
039859213c
commit
8a68f0aaf9
@@ -132,8 +132,8 @@ export class QueryTextEditor extends BaseTextEditor {
|
|||||||
|
|
||||||
public setHeightToScrollHeight(configChanged?: boolean): void {
|
public setHeightToScrollHeight(configChanged?: boolean): void {
|
||||||
let editorWidget = this.getControl() as ICodeEditor;
|
let editorWidget = this.getControl() as ICodeEditor;
|
||||||
if (!this._config) {
|
|
||||||
this._config = new Configuration(true, undefined, editorWidget.getDomNode(), this.accessibilityService);
|
this._config = new Configuration(true, undefined, editorWidget.getDomNode(), this.accessibilityService);
|
||||||
|
if (!this._scrollbarHeight) {
|
||||||
this._scrollbarHeight = this._config.editor.viewInfo.scrollbar.horizontalScrollbarSize;
|
this._scrollbarHeight = this._config.editor.viewInfo.scrollbar.horizontalScrollbarSize;
|
||||||
}
|
}
|
||||||
let editorWidgetModel = editorWidget.getModel();
|
let editorWidgetModel = editorWidget.getModel();
|
||||||
@@ -157,7 +157,8 @@ export class QueryTextEditor extends BaseTextEditor {
|
|||||||
for (let line = 1; line <= lineCount; line++) {
|
for (let line = 1; line <= lineCount; line++) {
|
||||||
// 4 columns is equivalent to the viewport column width and the edge of the editor
|
// 4 columns is equivalent to the viewport column width and the edge of the editor
|
||||||
if (editorWidgetModel.getLineMaxColumn(line) >= this._config.editor.layoutInfo.viewportColumn + 4) {
|
if (editorWidgetModel.getLineMaxColumn(line) >= this._config.editor.layoutInfo.viewportColumn + 4) {
|
||||||
numberWrappedLines += Math.ceil(editorWidgetModel.getLineMaxColumn(line) / this._config.editor.layoutInfo.viewportColumn);
|
// Subtract 1 because the first line should not count as a wrapped line
|
||||||
|
numberWrappedLines += Math.ceil(editorWidgetModel.getLineMaxColumn(line) / this._config.editor.layoutInfo.viewportColumn) - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user