vim-patch:8.1.0307: there is no good way to get the window layout

Problem:    There is no good way to get the window layout.
Solution:   Add the winlayout() function. (Yegappan Lakshmanan)
0f6b4f06de
This commit is contained in:
Jan Edmund Lazo
2019-05-25 21:59:33 -04:00
parent 08aa9b0023
commit f60af8694b
5 changed files with 105 additions and 0 deletions

View File

@@ -17872,6 +17872,25 @@ static void f_winheight(typval_T *argvars, typval_T *rettv, FunPtr fptr)
}
}
// "winlayout()" function
static void f_winlayout(typval_T *argvars, typval_T *rettv, FunPtr fptr)
{
tabpage_T *tp;
tv_list_alloc_ret(rettv, 2);
if (argvars[0].v_type == VAR_UNKNOWN) {
tp = curtab;
} else {
tp = find_tabpage((int)tv_get_number(&argvars[0]));
if (tp == NULL) {
return;
}
}
get_framelayout(tp->tp_topframe, rettv->vval.v_list, true);
}
/*
* "winline()" function
*/