Shield ghostel buffers from global default-text-properties#535
Merged
Conversation
line-spacing/line-height text properties supplied through the default-text-properties fallback inflate rendered rows invisibly to the window-screen-lines sizing math, so the grid overcounts rows and the bottom anchor vscrolls the top lines out of view (discussion #534). Set the variable buffer-locally to nil, next to the existing line-spacing override.
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.
Setting line geometry through
default-text-properties, e.g.inflates every rendered row via the text-property fallback, but those properties are invisible to
window-screen-lines/default-line-height(Emacs'default_line_pixel_heightdeliberately ignores line-height properties). The grid is therefore sized for more rows than fit the window body, and the bottom anchor vscrolls the top rows out of view — reported in discussion #534 ("vscrolls up, hiding the first two lines").Unlike the
line-spacingvariable (already pinned to 0 inghostel-mode), this mechanism can't be tolerated by better sizing math: no supported metric exposes property-driven row heights, and measuring rendered pixels would diverge from the unit the standardwindow-adjust-process-window-sizepath uses, reintroducing the #192 dual-authority resize problem.Fix: set
default-text-propertiesbuffer-locally tonilin theghostel-modebody, next to the existingline-spacingoverride. The user's global value stays untouched for all other buffers.Verified live (GUI Emacs, reporter's exact config): unpatched, rows render 15 px while all metrics report 14 px → 3 px vscroll and two hidden rows; patched, a fresh terminal renders 14 px rows, zero vscroll, all rows visible with the prompt bottom-aligned, and re-setting the global while the terminal runs cannot re-poison it. Includes a regression test asserting the buffer-local shield.