diff options
author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-08-15 11:53:38 -0400 |
---|---|---|
committer | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-08-15 12:20:46 -0400 |
commit | b89c08901c1e619b9aeca6f109f6ba73a7be4e9f (patch) | |
tree | 140e2d99f095c0739740189755f619306a6f3f0d /src/nvim/eval.c | |
parent | b5cfac089409faf17a290d4bfe1b669212e2984e (diff) | |
download | rneovim-b89c08901c1e619b9aeca6f109f6ba73a7be4e9f.tar.gz rneovim-b89c08901c1e619b9aeca6f109f6ba73a7be4e9f.tar.bz2 rneovim-b89c08901c1e619b9aeca6f109f6ba73a7be4e9f.zip |
vim-patch:8.0.1364: there is no easy way to get the window position
Problem: There is no easy way to get the window position.
Solution: Add win_screenpos().
https://github.com/vim/vim/commit/22044dc31788d9f1c2da7725269884d9923b4795
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 86f57ee5a2..17057ea28d 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -10310,6 +10310,15 @@ static void f_getwininfo(typval_T *argvars, typval_T *rettv, FunPtr fptr) } } +// "win_screenpos()" function +static void f_win_screenpos(typval_T *argvars, typval_T *rettv, FunPtr fptr) +{ + tv_list_alloc_ret(rettv, 2); + const win_T *const wp = find_win_by_nr(&argvars[0], NULL); + tv_list_append_number(rettv->vval.v_list, wp == NULL ? 0 : wp->w_winrow + 1); + tv_list_append_number(rettv->vval.v_list, wp == NULL ? 0 : wp->w_wincol + 1); +} + /* * "getwinposx()" function */ |