* Sets the horizontal scroll value of the editor. This is called when the editor is scrolled vertically using the scrollbar. * @param {number} value - The scroll value.
(value)
| 2544 | * @param {number} value - The scroll value. |
| 2545 | */ |
| 2546 | function onscrollH(value) { |
| 2547 | if (appSettings.value.textWrap) return; |
| 2548 | const scroller = editor?.scrollDOM; |
| 2549 | if (!scroller) return; |
| 2550 | suppressCursorReveal(); |
| 2551 | const normalized = clamp01(value); |
| 2552 | const maxScroll = Math.max(scroller.scrollWidth - scroller.clientWidth, 0); |
| 2553 | preventScrollbarH = true; |
| 2554 | scroller.scrollLeft = normalized * maxScroll; |
| 2555 | lastScrollLeft = scroller.scrollLeft; |
| 2556 | lockScrollbarScrollPosition({ left: lastScrollLeft }); |
| 2557 | } |
| 2558 | |
| 2559 | /** |
| 2560 | * Handles the event when the horizontal scrollbar reaches the end. |
nothing calls this directly
no test coverage detected