* Handles the scroll left event. * Updates the horizontal scroll value and renders the horizontal scrollbar.
()
| 2591 | * Updates the horizontal scroll value and renders the horizontal scrollbar. |
| 2592 | */ |
| 2593 | function onscrollleft() { |
| 2594 | if (appSettings.value.textWrap) { |
| 2595 | $hScrollbar.hide(); |
| 2596 | return; |
| 2597 | } |
| 2598 | const scroller = editor?.scrollDOM; |
| 2599 | if (!scroller) return; |
| 2600 | const maxScroll = Math.max(scroller.scrollWidth - scroller.clientWidth, 0); |
| 2601 | if (maxScroll <= 0) { |
| 2602 | $hScrollbar.hide(); |
| 2603 | lastScrollLeft = 0; |
| 2604 | $hScrollbar.value = 0; |
| 2605 | return; |
| 2606 | } |
| 2607 | setHScrollValue(); |
| 2608 | $hScrollbar.render(); |
| 2609 | } |
| 2610 | |
| 2611 | function readScrollMetrics() { |
| 2612 | const scroller = editor?.scrollDOM; |
nothing calls this directly
no test coverage detected