]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1944: getwininfo() does not return if statusline is visible v9.1.1944
authorHirohito Higashi <h.east.727@gmail.com>
Tue, 2 Dec 2025 19:58:01 +0000 (19:58 +0000)
committerChristian Brabandt <cb@256bit.org>
Tue, 2 Dec 2025 19:58:01 +0000 (19:58 +0000)
Problem:  gewininfo() does not return if statusline is visible
Solution: Add status_height to the dict items returned by
          getwininfo() (Hirohito Higashi)

closes: #18841

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/doc/builtin.txt
src/evalwindow.c
src/testdir/test_bufwintabinfo.vim
src/version.c

index 90f873e1d22765e574ce588b2fa047dc1275416c..0b5215d7ef1605b8816e09d426afea9e4b0830b2 100644 (file)
@@ -1,4 +1,4 @@
-*builtin.txt*  For Vim version 9.1.  Last change: 2025 Nov 28
+*builtin.txt*  For Vim version 9.1.  Last change: 2025 Dec 02
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -5343,9 +5343,13 @@ getwininfo([{winid}])                                    *getwininfo()*
                                        {only with the +quickfix feature}
                        quickfix        1 if quickfix or location list window
                                        {only with the +quickfix feature}
+                       status_height   status lines height (0 or 1)
+                       tabnr           tab page number
                        terminal        1 if a terminal window
                                        {only with the +terminal feature}
-                       tabnr           tab page number
+                       textoff         number of columns occupied by any
+                                       'foldcolumn', 'signcolumn' and line
+                                       number in front of the text
                        topline         first displayed buffer line
                        variables       a reference to the dictionary with
                                        window-local variables
@@ -5354,9 +5358,6 @@ getwininfo([{winid}])                                     *getwininfo()*
                                        otherwise
                        wincol          leftmost screen column of the window;
                                        "col" from |win_screenpos()|
-                       textoff         number of columns occupied by any
-                                       'foldcolumn', 'signcolumn' and line
-                                       number in front of the text
                        winid           |window-ID|
                        winnr           window number
                        winrow          topmost screen line of the window;
index 05c3d1d9bbf5735478c4c5f1b65fd78c27a61bf0..9a4efaa8c3f3e0a867271b6b152c6cabcd7d8784 100644 (file)
@@ -416,6 +416,7 @@ get_win_info(win_T *wp, short tpnr, short winnr)
     dict_add_number(dict, "winnr", winnr);
     dict_add_number(dict, "winid", wp->w_id);
     dict_add_number(dict, "height", wp->w_height);
+    dict_add_number(dict, "status_height", wp->w_status_height);
     dict_add_number(dict, "winrow", wp->w_winrow + 1);
     dict_add_number(dict, "topline", wp->w_topline);
     dict_add_number(dict, "botline", wp->w_botline - 1);
index f7318ff55ab8d41c21709688bb8054372ac81529..96dc0602330942c6108ff27c87fba094ab269fae 100644 (file)
@@ -204,4 +204,26 @@ func Test_getwininfo_au()
   bwipe!
 endfunc
 
+func Test_getwininfo_status_height()
+  set laststatus=0
+  vsplit
+  let info = getwininfo(win_getid())[0]
+  call assert_equal(0, info.status_height)
+
+  set laststatus=2
+  let info = getwininfo(win_getid())[0]
+  call assert_equal(1, info.status_height)
+
+  set laststatus=1
+  only
+  let info = getwininfo(win_getid())[0]
+  call assert_equal(0, info.status_height)
+  vsplit
+  let info = getwininfo(win_getid())[0]
+  call assert_equal(1, info.status_height)
+
+  set laststatus&vim
+  bwipe!
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab
index d347aac56c3d6aa1e59cdda03f708761c59a5002..000561a9e088abfeec99bc476a926664b4b74fba 100644 (file)
@@ -729,6 +729,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1944,
 /**/
     1943,
 /**/