diff --git a/src/vs/editor/browser/viewParts/lines/rangeUtil.ts b/src/vs/editor/browser/viewParts/lines/rangeUtil.ts index 7718ae4003a..56875381773 100644 --- a/src/vs/editor/browser/viewParts/lines/rangeUtil.ts +++ b/src/vs/editor/browser/viewParts/lines/rangeUtil.ts @@ -121,9 +121,9 @@ export class RangeUtil { startChildIndex = Math.min(max, Math.max(min, startChildIndex)); endChildIndex = Math.min(max, Math.max(min, endChildIndex)); - if (startChildIndex === endChildIndex && startOffset === endOffset && startOffset === 0) { + if (startChildIndex === endChildIndex && startOffset === endOffset && startOffset === 0 && !domNode.children[startChildIndex].firstChild) { // We must find the position at the beginning of a - // To cover cases of empty s, aboid using a range and use the 's bounding box + // To cover cases of empty s, avoid using a range and use the 's bounding box const clientRects = domNode.children[startChildIndex].getClientRects(); return this._createHorizontalRangesFromClientRects(clientRects, clientRectDeltaLeft); }