diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-10-20 18:46:05 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-10-20 18:46:05 +0200 |
commit | a13961536e5b1e686574826d4ed713e3d5526715 (patch) | |
tree | 63a0cbe0b2edab411bd7991afae9217b8b8e2729 /src/popupwin.c | |
parent | dca7abe79cc4f0933473c3e4bcc75b46cc2c48fd (diff) | |
download | vim-git-a13961536e5b1e686574826d4ed713e3d5526715.tar.gz |
patch 8.1.2193: popup_setoptions(popup_getoptions()) does not workv8.1.2193
Problem: Popup_setoptions(popup_getoptions()) does not work.
Solution: Also accept a list with three entries for "moved" and
"mousemoved". (closes #5081)
Diffstat (limited to 'src/popupwin.c')
-rw-r--r-- | src/popupwin.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/popupwin.c b/src/popupwin.c index 95435f8fe..a9579320e 100644 --- a/src/popupwin.c +++ b/src/popupwin.c @@ -493,12 +493,28 @@ handle_moved_argument(win_T *wp, dictitem_T *di, int mousemoved) } else if (di->di_tv.v_type == VAR_LIST && di->di_tv.vval.v_list != NULL - && di->di_tv.vval.v_list->lv_len == 2) + && (di->di_tv.vval.v_list->lv_len == 2 + || di->di_tv.vval.v_list->lv_len == 3)) { - list_T *l = di->di_tv.vval.v_list; - int mincol = tv_get_number(&l->lv_first->li_tv); - int maxcol = tv_get_number(&l->lv_first->li_next->li_tv); + list_T *l = di->di_tv.vval.v_list; + listitem_T *li = l->lv_first; + int mincol; + int maxcol; + if (di->di_tv.vval.v_list->lv_len == 3) + { + varnumber_T nr = tv_get_number(&l->lv_first->li_tv); + + // Three numbers, might be from popup_getoptions(). + if (mousemoved) + wp->w_popup_mouse_row = nr; + else + wp->w_popup_lnum = nr; + li = li->li_next; + } + + mincol = tv_get_number(&li->li_tv); + maxcol = tv_get_number(&li->li_next->li_tv); if (mousemoved) { wp->w_popup_mouse_mincol = mincol; |