Repository navigation
Map mouse rows from the buffer line under the pointer - #766
Merged
Merged
Conversation
ghostel--posn-cell derived the row from the pixel Y, assuming the window's top line is viewport row 0, or a partial scrollback line when there is a vscroll, and that every row is default-line-height tall. When that does not hold, e.g. while an enlarged minibuffer defers the terminal resize and the window starts below viewport row 0, or a row is taller than the default, mouse events sent to a mouse-tracking program landed one or more rows too high. Take the row from the viewport row of the position's buffer line instead, falling back to the pixel estimate only where a position has no buffer line (mode line, header line, frame). Closes #765.
dakra
force-pushed
the
fix/mouse-row-from-buffer
branch
from
October 26, 2026 18:02
f699483 to
42de3eb
Compare
This branch was previously deployed
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.
ghostel--posn-cellcomputed the mouse row from the pixel Y. That assumed the window's top line is viewport row 0, or a partial scrollback line whenever there is a vscroll, and that every row isdefault-line-heighttall. When either assumption breaks, events sent to mouse-tracking programs land one or more rows too high. Two cases that break it:The row is now the viewport row of the position's buffer line, via
ghostel--viewport-row-at. Scrollback positions clamp to row 0. Positions without a buffer line (mode line, header line, frame) keep the pixel estimate. The column calculation is unchanged.Checked live in elate, with clicks and drags compared against the old code:
ghostel-glyph-scale-floor1.0), the old code was off by up to 4 rows; the new code was exact.ghostel-window-padding-balanceset tocenter, both were correct.Closes #765.