diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-08-24 15:50:46 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-08-24 15:50:46 +0200 |
commit | 4645104be4c521dfdd43621c19e96bda3cac7be2 (patch) | |
tree | 2c680ce6963ee9d084fecd01d56588cca875feb0 /src/testdir | |
parent | e9a891f2559f0ef73596bce025e06bc36b092cbb (diff) |
patch 8.1.1919: using window options when passing a buffer to popup_create()v8.1.1919
Problem: Using current window option values when passing a buffer to
popup_create().
Solution: Clear the window-local options. (closes #4857)
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_popupwin.vim | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim index 810a2047c1..abae5dbef6 100644 --- a/src/testdir/test_popupwin.vim +++ b/src/testdir/test_popupwin.vim @@ -1814,15 +1814,25 @@ func Test_popupwin_with_buffer() call writefile(['some text', 'in a buffer'], 'XsomeFile') let buf = bufadd('XsomeFile') call assert_equal(0, bufloaded(buf)) + + setlocal number + call setbufvar(buf, "&wrapmargin", 13) + let winid = popup_create(buf, {}) call assert_notequal(0, winid) let pos = popup_getpos(winid) call assert_equal(2, pos.height) call assert_equal(1, bufloaded(buf)) + + " window-local option is set to default, buffer-local is not + call assert_equal(0, getwinvar(winid, '&number')) + call assert_equal(13, getbufvar(buf, '&wrapmargin')) + call popup_close(winid) call assert_equal({}, popup_getpos(winid)) call assert_equal(1, bufloaded(buf)) exe 'bwipe! ' .. buf + setlocal nonumber edit test_popupwin.vim let winid = popup_create(bufnr(''), {}) |