diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-05-25 21:59:33 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-05-26 07:27:50 -0400 |
commit | f60af8694b5fd7339e3b9883f6bc5be34852fd14 (patch) | |
tree | 4cab97c1a3ffc974d79afc01f4e7b6bb60dbc846 /src/nvim/eval.c | |
parent | 08aa9b00237ab45dadeffdf381e0e3c228337e53 (diff) | |
download | rneovim-f60af8694b5fd7339e3b9883f6bc5be34852fd14.tar.gz rneovim-f60af8694b5fd7339e3b9883f6bc5be34852fd14.tar.bz2 rneovim-f60af8694b5fd7339e3b9883f6bc5be34852fd14.zip |
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)
https://github.com/vim/vim/commit/0f6b4f06dece71487a6d8546c50de775d9c8c287
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 78a6092fa1..868305c88d 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -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 */ |