From 074bb2a2c0d8bb87f2621650a28891d322e564cc Mon Sep 17 00:00:00 2001 From: Cryplo Date: Sun, 6 Oct 2024 15:25:06 -0400 Subject: [PATCH] Add left and right conditions to caret scrolling to allow for horizontal scroll --- src/util/JsUtil.re | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/util/JsUtil.re b/src/util/JsUtil.re index bd8388b7ad..11a8fd7150 100644 --- a/src/util/JsUtil.re +++ b/src/util/JsUtil.re @@ -148,6 +148,10 @@ let scroll_cursor_into_view_if_needed = () => caret_elem##scrollIntoView(Js._true); } else if (caret_rect##.bottom > main_rect##.bottom) { caret_elem##scrollIntoView(Js._false); + } else if (caret_rect##.right > main_rect##.right) { + caret_elem##scrollIntoView(Js._true); + } else if (caret_rect##.left < main_rect##.left) { + caret_elem##scrollIntoView(Js._true); }; }) { | Assert_failure(_) => ()