aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2022-12-17 14:04:14 +0200
committerEli Zaretskii2022-12-17 14:04:14 +0200
commit4d1e4a48938be8a08e294b4a5711a2c8ce941a5a (patch)
treef1770d0578cd0722ee0f0d4c6236fa12fe210d24
parentd65beb820ccb8d9c91445a0d3993a0e64db8f683 (diff)
downloademacs-4d1e4a48938be8a08e294b4a5711a2c8ce941a5a.tar.gz
emacs-4d1e4a48938be8a08e294b4a5711a2c8ce941a5a.zip
Fix 'window-max-chars-per-line' when there are no fringes
* lisp/window.el (window-max-chars-per-line): Fix the way we account for the fringes by calling 'window-fringes'. (Bug#59963)
-rw-r--r--lisp/window.el15
1 files changed, 6 insertions, 9 deletions
diff --git a/lisp/window.el b/lisp/window.el
index 7d8ee48635a..a4a84218818 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -2162,17 +2162,14 @@ the font."
2162 (let* ((window-width (window-body-width window t)) 2162 (let* ((window-width (window-body-width window t))
2163 (font-width (window-font-width window face)) 2163 (font-width (window-font-width window face))
2164 (ncols (- (/ window-width font-width) 2164 (ncols (- (/ window-width font-width)
2165 (ceiling (line-number-display-width 'columns))))) 2165 (ceiling (line-number-display-width 'columns))))
2166 (fringes (window-fringes window))
2167 (lfringe (car fringes))
2168 (rfringe (nth 1 fringes)))
2166 (if (and (display-graphic-p) 2169 (if (and (display-graphic-p)
2167 overflow-newline-into-fringe 2170 overflow-newline-into-fringe
2168 (not 2171 (not (eq lfringe 0))
2169 (or (eq left-fringe-width 0) 2172 (not (eq rfringe 0)))
2170 (and (null left-fringe-width)
2171 (= (frame-parameter nil 'left-fringe) 0))))
2172 (not
2173 (or (eq right-fringe-width 0)
2174 (and (null right-fringe-width)
2175 (= (frame-parameter nil 'right-fringe) 0)))))
2176 ncols 2173 ncols
2177 ;; FIXME: This should remove 1 more column when there are no 2174 ;; FIXME: This should remove 1 more column when there are no
2178 ;; fringes, lines are truncated, and the window is hscrolled, 2175 ;; fringes, lines are truncated, and the window is hscrolled,