mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 17:19:48 +01:00
adds logging for when the width is 0 (#231121)
This commit is contained in:
committed by
GitHub
parent
204296f107
commit
c373439afc
@@ -17,7 +17,8 @@ import { RangeMapping } from '../../../../../common/diff/rangeMapping.js';
|
||||
export function maxLeftInRange(editor: ObservableCodeEditor, range: LineRange, reader: IReader): number {
|
||||
editor.layoutInfo.read(reader);
|
||||
editor.value.read(reader);
|
||||
const model = editor.model.get()!;
|
||||
|
||||
const model = editor.model.read(reader);
|
||||
if (!model) { return 0; }
|
||||
let maxLeft = 0;
|
||||
|
||||
@@ -27,6 +28,11 @@ export function maxLeftInRange(editor: ObservableCodeEditor, range: LineRange, r
|
||||
const left = editor.editor.getOffsetForColumn(i, column);
|
||||
maxLeft = Math.max(maxLeft, left);
|
||||
}
|
||||
const lines = range.mapToLineArray(l => model.getLineContent(l));
|
||||
|
||||
if (maxLeft < 5 && lines.some(l => l.length > 0) && model.uri.scheme !== 'file') {
|
||||
console.error('unexpected width');
|
||||
}
|
||||
return maxLeft;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user