mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
feature/popup: tweak popup rules, add +popup-shrink-to-fit
+popup-shrink-to-fit wraps shrink-window-if-larger-than-buffer, and won't do anything if the buffer is empty.
This commit is contained in:
@ -144,6 +144,16 @@ with ARGS to get its return value."
|
||||
"Returns a list of all popup windows."
|
||||
(cl-remove-if-not #'+popup-p (window-list)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +popup-shrink-to-fit (&optional window)
|
||||
"Shrinks WINDOW to fit the buffer contents, if the buffer isn't empty.
|
||||
|
||||
Uses `shrink-window-if-larger-than-buffer'."
|
||||
(unless window
|
||||
(setq window (selected-window)))
|
||||
(unless (= (- (point-max) (point-min)) 0)
|
||||
(shrink-window-if-larger-than-buffer window)))
|
||||
|
||||
|
||||
;;
|
||||
;; Minor mode
|
||||
|
Reference in New Issue
Block a user