Skip to content

Commit

Permalink
Correctly set per-window modeline
Browse files Browse the repository at this point in the history
This sets mode-line-format as a window parameter rather than the default
mode-line-format variable and doesn't override buffers that have
mode-line-format already set locally (most child-frame buffers).
  • Loading branch information
d4ncer committed Nov 17, 2021
1 parent 9fc1e1a commit 87b1fb1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions nano-modeline.el
Original file line number Diff line number Diff line change
Expand Up @@ -501,11 +501,12 @@ below or a buffer local variable 'no-mode-line'."
(with-selected-window window
(with-current-buffer (window-buffer window)
(if (or (not (boundp 'no-mode-line)) (not no-mode-line))
(setq mode-line-format
(cond ((one-window-p t) (list ""))
((eq (window-in-direction 'below) (minibuffer-window)) (list ""))
((not (window-in-direction 'below)) (list ""))
(t nil))))))))
(set-window-parameter window 'mode-line-format
(cond ((not mode-line-format) 'none)
((one-window-p t 'visible) (list ""))
((eq (window-in-direction 'below) (minibuffer-window)) (list ""))
((not (window-in-direction 'below)) (list ""))
(t 'none))))))))

(add-hook 'window-configuration-change-hook 'nano-modeline-update-windows)

Expand Down

0 comments on commit 87b1fb1

Please sign in to comment.