mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-15 17:22:25 -05:00
Ensure we call layout() as few times as possible for notebook cells (#7253)
* Call layout fewer times from queryTextEditor * remove unused method
This commit is contained in:
@@ -155,8 +155,8 @@ export class QueryTextEditor extends BaseTextEditor {
|
||||
let wordWrapEnabled: boolean = this._editorWorkspaceConfig && this._editorWorkspaceConfig['wordWrap'] && this._editorWorkspaceConfig['wordWrap'] === 'on' ? true : false;
|
||||
if (wordWrapEnabled) {
|
||||
for (let line = 1; line <= lineCount; line++) {
|
||||
// 4 columns is equivalent to the viewport column width and the edge of the editor
|
||||
if (editorWidgetModel.getLineMaxColumn(line) >= layoutInfo.viewportColumn + 4) {
|
||||
// 2 columns is equivalent to the viewport column width and the edge of the editor
|
||||
if (editorWidgetModel.getLineMaxColumn(line) >= layoutInfo.viewportColumn + 2) {
|
||||
// Subtract 1 because the first line should not count as a wrapped line
|
||||
numberWrappedLines += Math.ceil(editorWidgetModel.getLineMaxColumn(line) / layoutInfo.viewportColumn) - 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user