emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/olivetti 2e92258 103/134: Consider fringe width in curr


From: Stefan Monnier
Subject: [elpa] externals/olivetti 2e92258 103/134: Consider fringe width in current window when setting environment
Date: Thu, 25 Apr 2019 09:57:37 -0400 (EDT)

branch: externals/olivetti
commit 2e92258d62d3eceb033ff77638423ced3641a5fd
Author: Paul Rankin <address@hidden>
Commit: Paul Rankin <address@hidden>

    Consider fringe width in current window when setting environment
    
    Fixes #20
---
 olivetti.el | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/olivetti.el b/olivetti.el
index d523511..51de127 100644
--- a/olivetti.el
+++ b/olivetti.el
@@ -168,10 +168,16 @@ care that the maximum size is 0."
                                        (olivetti-scale-width 
olivetti-body-width)
                                      olivetti-body-width)
                                    window))
+           (fringes (window-fringes window))
+           (window-width (- (window-total-width window)
+                            (+ (/ (car fringes)
+                                  (float (frame-char-width)))
+                               (/ (cadr fringes)
+                                  (float (frame-char-width))))))
            (width (cond ((integerp n) n)
-                        ((floatp n) (* (window-total-width window)
+                        ((floatp n) (* window-width
                                        n))))
-           (margin (max (round (/ (- (window-total-width window)
+           (margin (max (round (/ (- window-width
                                      width)
                                   2))
                         0)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]