branch: externals/dired-preview
commit 077f24db3c363c9d50771acb26300dd9f4bdda21
Author: Protesilaos Stavrou <i...@protesilaos.com>
Commit: Protesilaos Stavrou <i...@protesilaos.com>

    Tweak how window size is calculated
---
 dired-preview.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/dired-preview.el b/dired-preview.el
index 99c2b3785c..b672b8342f 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -181,11 +181,14 @@ checked against `split-width-threshold' or
 `split-height-threshold'"
   (pcase dimension
     (:width (if (and (numberp split-width-threshold)
-                     (> (window-width) split-width-threshold)
+                     (> (window-total-width) split-width-threshold)
                      (> split-width-threshold fill-column))
                 split-width-threshold
               fill-column))
-    (:height (floor split-height-threshold 2))))
+    (:height (if (and (numberp split-height-threshold)
+                      (> (window-total-height) split-height-threshold))
+                 split-height-threshold
+               (floor (window-height) 2)))))
 
 (defun dired-preview-display-action-side ()
   "Pick a side window that is appropriate for the given frame."

Reply via email to