rougier / nano-modeline

GNU Emacs / N Λ N O Modeline
GNU General Public License v3.0
175 stars 31 forks source link

When minibuffer window is active, background modeline in (previously) active window is off #45

Closed apc closed 1 year ago

apc commented 1 year ago

I'm not sure what controls the look of the modeline in the active window when the minibuffer window is active, but something seems off. I think the issue is that the right fringe background color is not modified, unlike the background color of the rest of the modeline:

image

(This is using the built-in dichromancy theme, with fringe-mode set to default.)

It's even more noticeable if you increase the right fringe (here I set the right fringe to 80):

image

I can reproduce in vanilla emacs after installing nano-modeline (by calling package-install) and evaluating the following buffer:

(fringe-mode '(4 . 80))
(setq nano-modeline-position 'bottom)
(nano-modeline-mode)
image

(For clarity, the screenshot is taken after splitting the frame in two and calling switch-to-buffer.)

rougier commented 1 year ago

I do not modify the fringe, that might be the reason. But with vanilla emacs / default modeline, you have the same problem, do you?

apc commented 1 year ago

I'm not sure I understand. In vanilla emacs with the default modeline, the modeline has a constant background even when the fringe has a different color from the default background. E.g., trying out

(fringe-mode '(4 . 80))

and then calling switch-to-buffer gives me this:

image

Note the difference with what happens after installing nano-modeline, positioning the modeline at the bottom, activating nano-modeline-mode, and then calling switch-to-buffer:

image

The background only looks like this when the minibuffer is active. Otherwise, it looks as you'd expect:

image

From what I can tell, the problem is that when the minibuffer is active, part of the modeline is using the mode-line-inactive but the bit above the fringe on the right continues to use the mode-line-active face.

image

And changing the color of the fringe doesn't change the color of the segment of the modeline right above the right fringe, e.g.:

image
apc commented 1 year ago

PS: more evidence that this seems unrelated to the background color of the fringe:

image
rougier commented 1 year ago

I see. I think the problem is that the modeline stops at the right border instead of the right fringe border. I'll look into that. Or if you want to experiment, you can have a look at line 490 and pixel specifications. Maybe replacing right-margin with right-fringe could do the trick.

apc commented 1 year ago

That almost does the trick, but not quite. When there is line number info on the right, sometimes you still see a bit of the different color e.g.:

image
aaronjensen commented 1 year ago

@apc see if you can reproduce it with my fork: https://github.com/aaronjensen/nano-modeline/blob/master/nano-modeline.el

I don't vary the background color at all, so I don't know if I have the problem and just can't see it or not.

apc commented 1 year ago

@aaronjensen yes, I get the same behavior. From what I can tell, the problem is visible only when the faces mode-line and mode-line-inactive have different background colors. The faces nano-modeline-active and nano-modeline-inactive are inheriting the background colors from those two, and when the modeline doesn't extend all the way to the end of the fringe, you still see the background color of the mode-line face over the fringe.

rougier commented 1 year ago

Isn't it the window divider that you see? Can you try to change the window-divider face to yellow to be sure?

apc commented 1 year ago

I'm pretty sure it's not the window-divider. I think it's the scroll-bar.

image

Look at the difference when I turn off scroll-bar-mode:

image
rougier commented 1 year ago

Can you try aligning with scroll-bar instead of left-margin?

rougier commented 1 year ago

I might be fixed with the new simpler branch. Coudl you give it a try?