From 5d78e4cd5fd060577725f8ce7600ab5e96ec6a18 Mon Sep 17 00:00:00 2001 From: Zumbala Date: Sun, 13 Feb 2022 20:02:45 +0100 Subject: [PATCH] Using line number When using line numbers the viewport is moved using transform, except the width is not changed to allow for correct visualisation --- src/codeflask.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/codeflask.js b/src/codeflask.js index 241a318d..9c9b4d30 100644 --- a/src/codeflask.js +++ b/src/codeflask.js @@ -182,6 +182,8 @@ export default class CodeFlask { this.elPre.style.transform = `translate3d(-${e.target.scrollLeft}px, -${e.target.scrollTop}px, 0)` if (this.elLineNumbers) { this.elLineNumbers.style.transform = `translate3d(0, -${e.target.scrollTop}px, 0)` + // missing width change when moving the viewport left + this.elPre.style.width = this.elPre.clientWidth + e.target.scrollLeft + "px" } }) }