Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;; if i alway open new buffer it works virtually perfect
- ;; we have to be sure to disable the modeline for that window
- ;; so the other buffers could still have it if their position say so
- (defun window-touches-bottom-p (win)
- "Check if WIN is touching the bottom of the frame."
- (let* ((edges (window-edges win nil t t))
- (bottom-edge (nth 3 edges))
- (frame-height (frame-pixel-height))
- ;; Define a tolerance of 10 pixels
- (tolerance 10))
- ;; Check if the window's bottom edge is within the tolerance of the frame's height
- (<= (abs (- bottom-edge frame-height)) tolerance)))
- (defun adjust-modelines-based-on-geometry ()
- "Adjust modelines based on window geometry."
- (dolist (win (window-list))
- (with-selected-window win
- (if (window-touches-bottom-p win)
- (setq-local mode-line-format (default-value 'mode-line-format))
- (setq-local mode-line-format nil)))))
- (add-hook 'window-configuration-change-hook 'adjust-modelines-based-on-geometry)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement