MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / onscrollH

Function onscrollH

src/lib/editorManager.js:2546–2557  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 3

suppressCursorRevealFunction · 0.85
clamp01Function · 0.85

Tested by

no test coverage detected