Commit 02fa69d 1 parent 0a7e221 commit 02fa69d Copy full SHA for 02fa69d
File tree 1 file changed +7
-5
lines changed
src/vs/editor/browser/viewParts/lines
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -220,6 +220,8 @@ export class ViewLine implements IVisibleLine {
220
220
}
221
221
222
222
public getVisibleRangesForRange ( startColumn : number , endColumn : number , context : DomReadingContext ) : HorizontalRange [ ] {
223
+ startColumn = Math . min ( this . _renderedViewLine . input . lineContent . length + 1 , Math . max ( 1 , startColumn ) ) ;
224
+ endColumn = Math . min ( this . _renderedViewLine . input . lineContent . length + 1 , Math . max ( 1 , endColumn ) ) ;
223
225
return this . _renderedViewLine . getVisibleRangesForRange ( startColumn , endColumn , context ) ;
224
226
}
225
227
@@ -440,6 +442,11 @@ class RenderedViewLine {
440
442
}
441
443
442
444
protected _readPixelOffset ( column : number , context : DomReadingContext ) : number {
445
+ if ( this . _characterMapping . length === 0 ) {
446
+ // This line is empty
447
+ return 0 ;
448
+ }
449
+
443
450
if ( this . _pixelOffsetCache !== null ) {
444
451
// the text is LTR
445
452
@@ -458,11 +465,6 @@ class RenderedViewLine {
458
465
459
466
private _actualReadPixelOffset ( column : number , context : DomReadingContext ) : number {
460
467
461
- if ( this . _characterMapping . length === 0 ) {
462
- // This line is empty
463
- return 0 ;
464
- }
465
-
466
468
if ( column === this . _characterMapping . length && this . _isWhitespaceOnly ) {
467
469
// This branch helps in the case of whitespace only lines which have a width set
468
470
return this . getWidth ( ) ;
You can’t perform that action at this time.
0 commit comments