Mercurial > vim
diff src/testdir/test_popupwin.vim @ 16843:283037126560 v8.1.1423
patch 8.1.1423: popup windows use options from current window and buffer
commit https://github.com/vim/vim/commit/cacc6a5c986fbc716bf53b6916f076dd7b388142
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu May 30 15:22:43 2019 +0200
patch 8.1.1423: popup windows use options from current window and buffer
Problem: Popup windows use options from current window and buffer.
Solution: Clear all local options when creating a popup window.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 30 May 2019 15:30:05 +0200 |
parents | cf630fab9fb6 |
children | 629f3d3b6886 |
line wrap: on
line diff
--- a/src/testdir/test_popupwin.vim +++ b/src/testdir/test_popupwin.vim @@ -264,3 +264,26 @@ func Test_popup_getoptions() call popup_close(winid) call assert_equal({}, popup_getoptions(winid)) endfunc + +func Test_popup_option_values() + new + " window-local + setlocal number + setlocal nowrap + " buffer-local + setlocal omnifunc=Something + " global/buffer-local + setlocal path=/there + " global/window-local + setlocal scrolloff=9 + + let winid = popup_create('hello', {}) + call assert_equal(0, getwinvar(winid, '&number')) + call assert_equal(1, getwinvar(winid, '&wrap')) + call assert_equal('', getwinvar(winid, '&omnifunc')) + call assert_equal(&g:path, getwinvar(winid, '&path')) + call assert_equal(&g:scrolloff, getwinvar(winid, '&scrolloff')) + + call popup_close(winid) + bwipe +endfunc