aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-02-13 07:27:27 +0800
committerGitHub <noreply@github.com>2024-02-13 07:27:27 +0800
commit2493fd020d6f294c78a87b0f7f35c0398b248f1f (patch)
tree55042d7b1ec1db58be1096bf442e00d577bebe74 /test
parent94085cfce82153e79eba5a1d277fe5799d973ffd (diff)
downloadrneovim-2493fd020d6f294c78a87b0f7f35c0398b248f1f.tar.gz
rneovim-2493fd020d6f294c78a87b0f7f35c0398b248f1f.tar.bz2
rneovim-2493fd020d6f294c78a87b0f7f35c0398b248f1f.zip
vim-patch:9.1.0102: settabvar() may change the last accessed tabpage (#27450)
Problem: settabvar() may change the last accessed tabpage. Solution: Save and restore lastused_tabpage. (zeertzjq) closes: vim/vim#14017 https://github.com/vim/vim/commit/b47fbb40837512cdd2d8c25eaf9952154836b99d
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_tabpage.vim17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/old/testdir/test_tabpage.vim b/test/old/testdir/test_tabpage.vim
index adb9e13269..0f038c8bee 100644
--- a/test/old/testdir/test_tabpage.vim
+++ b/test/old/testdir/test_tabpage.vim
@@ -995,4 +995,21 @@ func Test_tabpage_drop_tabmove()
bwipe!
endfunc
+" Test that settabvar() shouldn't change the last accessed tabpage.
+func Test_lastused_tabpage_settabvar()
+ tabonly!
+ tabnew
+ tabnew
+ tabnew
+ call assert_equal(3, tabpagenr('#'))
+
+ call settabvar(2, 'myvar', 'tabval')
+ call assert_equal('tabval', gettabvar(2, 'myvar'))
+ call assert_equal(3, tabpagenr('#'))
+
+ bwipe!
+ bwipe!
+ bwipe!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab