Skip to content

Commit

Permalink
fix: horizontal scroll for rtl (#21)
Browse files Browse the repository at this point in the history
* fix: horizontal scroll for rtl

Signed-off-by: Steven E Wright <StevenEWright@users.noreply.github.com>

* fix: == vs ===

Signed-off-by: Steven E Wright <StevenEWright@users.noreply.github.com>

---------

Signed-off-by: Steven E Wright <StevenEWright@users.noreply.github.com>
  • Loading branch information
StevenEWright committed Aug 12, 2023
1 parent f15c1ae commit e33a998
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/internals/text_editor/text_editor_view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ export class TextEditorView {
}
this._formattedDisplay.style.inset = this.insetWithLeading(
`-${this.element.scrollTop}px`,
`calc(-${this.element.scrollLeft}px + ${this._gutterWidth})`
`calc(${(this._dir === 'ltr' ? -1 : 1) * this.element.scrollLeft}px + ${this._gutterWidth})`
);
}

Expand Down

0 comments on commit e33a998

Please sign in to comment.