Mercurial > vim
changeset 22063:0716b3299872 v8.2.1581
patch 8.2.1581: using line() for global popup window doesn't work
Commit: https://github.com/vim/vim/commit/1f42f5a675fdab9ce5cdafbecea59c45e81f7ff8
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Sep 3 18:52:24 2020 +0200
patch 8.2.1581: using line() for global popup window doesn't work
Problem: Using line() for global popup window doesn't work.
Solution: Set tabpage to "curtab". (closes https://github.com/vim/vim/issues/6847)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 03 Sep 2020 19:00:04 +0200 |
parents | bc6af644cd49 |
children | cfabacbdd14f |
files | src/evalwindow.c src/testdir/test_popupwin.vim src/version.c |
diffstat | 3 files changed, 15 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/evalwindow.c +++ b/src/evalwindow.c @@ -117,7 +117,7 @@ win_id2wp_tp(int id, tabpage_T **tpp) if (wp->w_id == id) { if (tpp != NULL) - *tpp = tp; + *tpp = curtab; // any tabpage would do return wp; } #endif
--- a/src/testdir/test_popupwin.vim +++ b/src/testdir/test_popupwin.vim @@ -2239,6 +2239,18 @@ func Test_popup_settext() call delete('XtestPopupSetText') endfunc +func Test_popup_settext_getline() + let id = popup_create('', #{ tabpage: 0 }) + call popup_settext(id, ['a','b']) + call assert_equal(2, line('$', id)) " OK :) + call popup_close(id) + + let id = popup_create('', #{ tabpage: -1 }) + call popup_settext(id, ['a','b']) + call assert_equal(2, line('$', id)) " Fails :( + call popup_close(id) +endfunc + func Test_popup_hidden() new