branch: externals/olivetti
commit 2e92258d62d3eceb033ff77638423ced3641a5fd
Author: Paul Rankin <[email protected]>
Commit: Paul Rankin <[email protected]>
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)))