Skip to content

Commit

Permalink
Fix modes not restoring mode-line when disabled
Browse files Browse the repository at this point in the history
Seems in some odd cases where {global-,}hide-mode-line-mode is
interactively disabled, the mode-line isn't always entirely redrawn when
mode-line-format is restored (i.e. force-mode-line-update is
insufficient). This causes the restored mode-line to remain invisible. A
forced redraw is needed.

Fix #4
Fix #2
  • Loading branch information
hlissner committed Nov 12, 2021
1 parent 8888882 commit cc81ba3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hide-mode-line.el
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
(remove-hook 'after-change-major-mode-hook #'hide-mode-line-reset t)
(setq mode-line-format hide-mode-line--old-format
hide-mode-line--old-format nil))
(force-mode-line-update))
(when (called-interactively-p 'any)
(redraw-display)))

;; Ensure major-mode or theme changes don't overwrite these variables
(put 'hide-mode-line--old-format 'permanent-local t)
Expand All @@ -68,7 +69,8 @@ cycled to fix this."

;;;###autoload
(define-globalized-minor-mode global-hide-mode-line-mode
hide-mode-line-mode turn-on-hide-mode-line-mode)
hide-mode-line-mode turn-on-hide-mode-line-mode
(redraw-display))

;;;###autoload
(defun turn-on-hide-mode-line-mode ()
Expand Down

0 comments on commit cc81ba3

Please sign in to comment.