mirror of
https://github.com/vim/vim.git
synced 2025-12-10 18:46:57 -05:00
patch 9.1.1944: getwininfo() does not return if statusline is visible
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>
This commit is contained in:
committed by
Christian Brabandt
parent
c3cfdefdee
commit
a04ab5f04c
@ -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);
|
||||
|
||||
@ -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
|
||||
|
||||
@ -729,6 +729,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1944,
|
||||
/**/
|
||||
1943,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user