aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/window.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/window.c b/src/window.c
index 9026a7b5f2a..9cde2c5ecc4 100644
--- a/src/window.c
+++ b/src/window.c
@@ -4934,25 +4934,21 @@ window_wants_header_line (struct window *w)
4934 : 0); 4934 : 0);
4935} 4935}
4936 4936
4937/* Return number of lines of text (not counting mode lines) in W. */ 4937/* Return number of lines of text in window W, not counting the mode
4938 line and header line, if any. Do NOT use this for windows on GUI
4939 frames; use window_body_height instead. This function is only for
4940 windows on TTY frames, where it is much more efficient. */
4938 4941
4939int 4942int
4940window_internal_height (struct window *w) 4943window_internal_height (struct window *w)
4941{ 4944{
4942 int ht = w->total_lines; 4945 int ht = w->total_lines;
4943 4946
4944 if (!MINI_WINDOW_P (w)) 4947 if (window_wants_mode_line (w))
4945 { 4948 --ht;
4946 if (!NILP (w->parent)
4947 || WINDOWP (w->contents)
4948 || !NILP (w->next)
4949 || !NILP (w->prev)
4950 || window_wants_mode_line (w))
4951 --ht;
4952 4949
4953 if (window_wants_header_line (w)) 4950 if (window_wants_header_line (w))
4954 --ht; 4951 --ht;
4955 }
4956 4952
4957 return ht; 4953 return ht;
4958} 4954}