]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix line width in M-x term on -nw with line numbers
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 21 Sep 2020 14:10:13 +0000 (16:10 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 21 Sep 2020 14:10:13 +0000 (16:10 +0200)
* lisp/window.el (window-max-chars-per-line): Make the line width
more correct in the presence of display-line-numbers-mode (bug#34513).

lisp/window.el

index f1ee87aad25029ff809aaaaf9967559c13057ce2..72957d846aed281660c8e2da3633017268da2a5a 100644 (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