]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve the `long' computation of `mode-line-compact'
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 30 Dec 2020 02:34:17 +0000 (03:34 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 30 Dec 2020 02:34:17 +0000 (03:34 +0100)
* src/xdisp.c (display_mode_line): Compute `long' based on total
window width, and use the passed-in window instead of the selected
window.

src/xdisp.c

index 7ad6b1b1892c7893ece1930100c42e85e83455ce..7b430041f986938e76a1f05a1c6d706f905b84e8 100644 (file)
@@ -25467,8 +25467,7 @@ display_mode_line (struct window *w, enum face_id face_id, Lisp_Object format)
     {
       Lisp_Object mode_string = Fformat_mode_line (format, Qnil, Qnil, Qnil);
       if (EQ (Vmode_line_compact, Qlong)
-         && window_body_width (XWINDOW (selected_window), false) >=
-         SCHARS (mode_string))
+         && WINDOW_TOTAL_COLS (w) >= SCHARS (mode_string))
        {
          /* The window is wide enough; just display the mode line we
             just computed. */