From efc1b1101a524c6a23bcb8ba828b3cf36c81040c Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Fri, 3 Jul 2026 05:22:57 -0400 Subject: fix(modeline): pin padding height to the frame, not the buffer The leading modeline space set its height with a display (height 1.15) property, which scales against the buffer's default face. nov-mode's reading view remaps default to 18pt, so there the padding grew to 1.15x that and the bar rendered far taller than normal. The theme's absolute mode-line height couldn't help, since the padding space drives the strip height, not the face. The padding now uses an absolute integer height anchored to the frame's default face, so a buffer that enlarges its own default (nov, text-scale) no longer inflates the bar. Normal buffers are unchanged, and the nov bar matches them. --- modules/modeline-config.el | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'modules') diff --git a/modules/modeline-config.el b/modules/modeline-config.el index be7f72e5..6ba6efca 100644 --- a/modules/modeline-config.el +++ b/modules/modeline-config.el @@ -126,12 +126,19 @@ kills the buffer-local value so the default format returns." (defun cj/--modeline-padding () "Return the leading modeline space, taller per `cj/modeline-height-factor'. -A display height property on a single space pads the whole modeline -vertically without touching the mode-line faces the theme owns." - (if (and cj/modeline-height-factor - (/= cj/modeline-height-factor 1.0)) - (propertize " " 'display `(height ,cj/modeline-height-factor)) - " ")) +An absolute :height face on a single space pads the whole modeline +vertically. The height is anchored to the frame's default face rather +than the current buffer's, so a buffer that remaps `default' larger — +nov-mode's reading view, `text-scale-mode' — no longer inflates the bar. +A `display (height FACTOR)' property would scale with the buffer's default +face and blow the modeline up in those buffers." + (let ((base (face-attribute 'default :height nil t))) + (if (and cj/modeline-height-factor + (/= cj/modeline-height-factor 1.0) + (integerp base)) + (propertize " " 'face + (list :height (round (* cj/modeline-height-factor base)))) + " "))) (defvar-local cj/--modeline-mode-icon-cache nil "Cons of (MAJOR-MODE . GRAPHIC-P) paired with the rendered mode segment. -- cgit v1.2.3