From e8d80f1e14c8efe42d59cf856cf403ec48dfe70b Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 21 Sep 2020 16:10:13 +0200 Subject: [PATCH] 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). --- lisp/window.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/window.el b/lisp/window.el index f1ee87aad25..72957d846ae 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -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 -- 2.39.2