comparison src/popupwin.c @ 18398:21c25bee9df8 v8.1.2193

patch 8.1.2193: popup_setoptions(popup_getoptions()) does not work Commit: https://github.com/vim/vim/commit/a13961536e5b1e686574826d4ed713e3d5526715 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Oct 20 18:46:05 2019 +0200 patch 8.1.2193: popup_setoptions(popup_getoptions()) does not work Problem: Popup_setoptions(popup_getoptions()) does not work. Solution: Also accept a list with three entries for "moved" and "mousemoved". (closes #5081)
author Bram Moolenaar <Bram@vim.org>
date Sun, 20 Oct 2019 19:00:03 +0200
parents ba5d8c5d77d7
children ee8db42dacf6
comparison
equal deleted inserted replaced
18397:3bc55782efa5 18398:21c25bee9df8
491 set_moved_columns(wp, flags); 491 set_moved_columns(wp, flags);
492 } 492 }
493 } 493 }
494 else if (di->di_tv.v_type == VAR_LIST 494 else if (di->di_tv.v_type == VAR_LIST
495 && di->di_tv.vval.v_list != NULL 495 && di->di_tv.vval.v_list != NULL
496 && di->di_tv.vval.v_list->lv_len == 2) 496 && (di->di_tv.vval.v_list->lv_len == 2
497 { 497 || di->di_tv.vval.v_list->lv_len == 3))
498 list_T *l = di->di_tv.vval.v_list; 498 {
499 int mincol = tv_get_number(&l->lv_first->li_tv); 499 list_T *l = di->di_tv.vval.v_list;
500 int maxcol = tv_get_number(&l->lv_first->li_next->li_tv); 500 listitem_T *li = l->lv_first;
501 501 int mincol;
502 int maxcol;
503
504 if (di->di_tv.vval.v_list->lv_len == 3)
505 {
506 varnumber_T nr = tv_get_number(&l->lv_first->li_tv);
507
508 // Three numbers, might be from popup_getoptions().
509 if (mousemoved)
510 wp->w_popup_mouse_row = nr;
511 else
512 wp->w_popup_lnum = nr;
513 li = li->li_next;
514 }
515
516 mincol = tv_get_number(&li->li_tv);
517 maxcol = tv_get_number(&li->li_next->li_tv);
502 if (mousemoved) 518 if (mousemoved)
503 { 519 {
504 wp->w_popup_mouse_mincol = mincol; 520 wp->w_popup_mouse_mincol = mincol;
505 wp->w_popup_mouse_maxcol = maxcol; 521 wp->w_popup_mouse_maxcol = maxcol;
506 } 522 }