Translate gutter so it remains visible when scrolling to the right

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
Nathan Sobo
2017-02-23 13:24:59 -07:00
committed by Antonio Scandurra
parent d2d560eac6
commit 9765d9dbcd
2 changed files with 13 additions and 3 deletions

View File

@@ -51,9 +51,18 @@ class TextEditorComponent {
}
renderGutterContainer () {
return $.div({className: 'gutter-container'},
this.renderLineNumberGutter()
)
const props = {className: 'gutter-container'}
if (this.measurements) {
props.style = {
position: 'relative',
willChange: 'transform',
transform: `translateX(${this.measurements.scrollLeft}px)`,
zIndex: 1
}
}
return $.div(props, this.renderLineNumberGutter())
}
renderLineNumberGutter () {