Fix line width in M-x term on -nw with line numbers

* lisp/window.el (window-max-chars-per-line): Make the line width
more correct in the presence of display-line-numbers-mode (bug#34513).
This commit is contained in:
Lars Ingebrigtsen 2020-09-21 16:10:13 +02:00
parent d2b754ec1a
commit e8d80f1e14

View file

@ -2172,7 +2172,8 @@ the font."
(with-selected-window (window-normalize-window window t)
(let* ((window-width (window-body-width window t))
(font-width (window-font-width window face))
(ncols (/ window-width font-width)))
(ncols (- (/ window-width font-width)
(line-number-display-width 'columns))))
(if (and (display-graphic-p)
overflow-newline-into-fringe
(not