From ee1de0980f4923d3638b7355b3dc7ed32abf50ce Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Fri, 10 Feb 2017 09:55:35 -0800 Subject: [PATCH] Perform initial viewport sync after CharMeasure is ready Fixes #539 --- src/Viewport.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Viewport.ts b/src/Viewport.ts index aaafbc5f..dc7ff7c3 100644 --- a/src/Viewport.ts +++ b/src/Viewport.ts @@ -35,7 +35,8 @@ export class Viewport { this.terminal.on('resize', this.syncScrollArea.bind(this)); this.viewportElement.addEventListener('scroll', this.onScroll.bind(this)); - this.syncScrollArea(); + // Perform this async to ensure the CharMeasure is ready. + setTimeout(() => this.syncScrollArea(), 0); } /**