summaryrefslogtreecommitdiff
path: root/src/testdir/test_getvar.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-09-29 21:29:18 +0200
committerBram Moolenaar <Bram@vim.org>2017-09-29 21:29:18 +0200
commit816968defc8ae79eb7e2319e991e74661be8d750 (patch)
treeddb01de7db656fdbd9f673e54785860c93379cf7 /src/testdir/test_getvar.vim
parentd371bbe0ab4b07dd3aa8d0f77905d222f6c5fd7e (diff)
downloadvim-git-816968defc8ae79eb7e2319e991e74661be8d750.tar.gz
patch 8.0.1160: getting tab-local variable fails after closing windowv8.0.1160
Problem: Getting tab-local variable fails after closing window. Solution: set tp_firstwin and tp_lastwin. (Jason Franklin, closes #2170)
Diffstat (limited to 'src/testdir/test_getvar.vim')
-rw-r--r--src/testdir/test_getvar.vim16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/testdir/test_getvar.vim b/src/testdir/test_getvar.vim
index 0f5dff5d1..d6b6b69aa 100644
--- a/src/testdir/test_getvar.vim
+++ b/src/testdir/test_getvar.vim
@@ -86,3 +86,19 @@ func Test_var()
call assert_equal(1, gettabwinvar(2, 3, '&nux', 1))
tabonly
endfunc
+
+" It was discovered that "gettabvar()" would fail if called from within the
+" tabline when the user closed a window. This test confirms the fix.
+func Test_gettabvar_in_tabline()
+ let t:var_str = 'value'
+
+ set tabline=%{assert_equal('value',gettabvar(1,'var_str'))}
+ set showtabline=2
+
+ " Simulate the user opening a split (which becomes window #1) and then
+ " closing the split, which triggers the redrawing of the tabline.
+ leftabove split
+ redrawstatus!
+ close
+ redrawstatus!
+endfunc