File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
src/vs/editor/browser/controller Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -650,7 +650,14 @@ export class TextAreaHandler extends ViewPart {
650
650
651
651
let scrollLeft = this . _visibleTextArea . widthOfHiddenLineTextBefore ;
652
652
let left = ( this . _contentLeft + visibleStart . left - this . _scrollLeft ) ;
653
- let width = visibleEnd . left - visibleStart . left ;
653
+ // See https://github.com/microsoft/vscode/issues/141725#issuecomment-1050670841
654
+ // Here we are adding +1 to avoid flickering that might be caused by having a width that is too small.
655
+ // This could be caused by rounding errors that might only show up with certain font families.
656
+ // In other words, a pixel might be lost when doing something like
657
+ // `Math.round(end) - Math.round(start)`
658
+ // vs
659
+ // `Math.round(end - start)`
660
+ let width = visibleEnd . left - visibleStart . left + 1 ;
654
661
if ( left < this . _contentLeft ) {
655
662
// the textarea would be rendered on top of the margin,
656
663
// so reduce its width. We use the same technique as
You can’t perform that action at this time.
0 commit comments