feat: horizontal mouse-wheel scrolling for the bufferline#1053
Open
tusharmurali wants to merge 1 commit into
Open
feat: horizontal mouse-wheel scrolling for the bufferline#1053tusharmurali wants to merge 1 commit into
tusharmurali wants to merge 1 commit into
Conversation
Scrolling the mouse wheel over the bufferline now shifts the visible
window of buffers/tabs to reveal off-screen ones, without changing the
active buffer. Opt-in via `mouse_scroll = { enabled = true, step = 1 }`,
mirroring the existing `hover` option.
The scroll position is persisted in state and honored by a parallel
windowing path in the renderer, leaving the centring `truncate` logic
untouched. The view snaps back to auto-centring when the active buffer
or the buffer list changes.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds opt-in horizontal mouse-wheel scrolling of the bufferline. When more buffers/tabs are open than fit on screen, scrolling the wheel while hovering over the bufferline shifts the visible window left/right to reveal off-screen buffers — without changing the active buffer (view-only scroll, like scrolling a horizontal list).
Enable it via:
Disabled by default, mirroring the existing
hoveroption.How it works
lua/bufferline/scroll.luaregisters<ScrollWheelUp/Down/Left/Right>expr-keymaps, mirroringhover.lua's<MouseMove>pattern. Each acts only when the mouse is over the tabline (screenrow == 1) and otherwise returns the original key, so scrolling over normal windows is unaffected. Both vertical and horizontal wheels drive horizontal movement (up/left = towards the start).scroll_offset) and honored by a parallel windowing path in the renderer (max_scroll_pivot+scroll_windowinui.lua). This leaves the existing, well-tested centringtruncatelogic untouched — it's only bypassed while actively scrolled.stepcontrols how many buffers each wheel tick moves the view by.Notes
buffersandtabsmode.mouseto be enabled. Delivery of<ScrollWheel*>events over the tabline row depends on the terminal/multiplexer (the same assumption the existing hover feature makes for<MouseMove>).Tests
Adds unit tests in
tests/ui_spec.luacovering the scroll-pivot clamping, window building/marker counts, and the handler's offset capture + clamping. Full suite passes andstyluais clean.