Skip to content

Commit

Permalink
Consider fringe width in current window when setting environment
Browse files Browse the repository at this point in the history
Fixes #20
  • Loading branch information
rnkn committed Dec 7, 2017
1 parent 8b29e55 commit 22f16a9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions olivetti.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down

0 comments on commit 22f16a9

Please sign in to comment.