emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-26 ea1a014: Fix window scrolling on TTY frames when


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-26 ea1a014: Fix window scrolling on TTY frames when there's no mode line
Date: Mon, 19 Nov 2018 13:12:50 -0500 (EST)

branch: emacs-26
commit ea1a0149825048da940365b79948e71cfc366385
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Fix window scrolling on TTY frames when there's no mode line
    
    * src/window.c (window_internal_height): Remove tests for
    next, prev, and parent pointers, as they are unrelated to
    whether a window has a mode line.  (Bug#33363)
---
 src/window.c | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/src/window.c b/src/window.c
index 9026a7b..9cde2c5 100644
--- a/src/window.c
+++ b/src/window.c
@@ -4934,25 +4934,21 @@ window_wants_header_line (struct window *w)
          : 0);
 }
 
-/* Return number of lines of text (not counting mode lines) in W.  */
+/* Return number of lines of text in window W, not counting the mode
+   line and header line, if any.  Do NOT use this for windows on GUI
+   frames; use window_body_height instead.  This function is only for
+   windows on TTY frames, where it is much more efficient.  */
 
 int
 window_internal_height (struct window *w)
 {
   int ht = w->total_lines;
 
-  if (!MINI_WINDOW_P (w))
-    {
-      if (!NILP (w->parent)
-         || WINDOWP (w->contents)
-         || !NILP (w->next)
-         || !NILP (w->prev)
-         || window_wants_mode_line (w))
-       --ht;
+  if (window_wants_mode_line (w))
+    --ht;
 
-      if (window_wants_header_line (w))
-       --ht;
-    }
+  if (window_wants_header_line (w))
+    --ht;
 
   return ht;
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]