From d7b942b54e4bae5510549ceffb3280e89871cff5 Mon Sep 17 00:00:00 2001 From: Grzegorz Milka Date: Sun, 23 Oct 2016 00:00:47 +0200 Subject: vim-patch:7.4.2237 Problem: Can't use "." and "$" with ":tab". Solution: Support a range for ":tab". (Hirohito Higashi) https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c --- src/nvim/testdir/test_tabpage.vim | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_tabpage.vim b/src/nvim/testdir/test_tabpage.vim index e6b85d6e14..f1c41e967b 100644 --- a/src/nvim/testdir/test_tabpage.vim +++ b/src/nvim/testdir/test_tabpage.vim @@ -186,4 +186,36 @@ function Test_tabpage_with_autocmd() bw! endfunction +function Test_tabpage_with_tab_modifier() + for n in range(4) + tabedit + endfor + + function s:check_tab(pre_nr, cmd, post_nr) + exec 'tabnext ' . a:pre_nr + exec a:cmd + call assert_equal(a:post_nr, tabpagenr()) + call assert_equal('help', &filetype) + helpclose + endfunc + + call s:check_tab(1, 'tab help', 2) + call s:check_tab(1, '3tab help', 4) + call s:check_tab(1, '.tab help', 2) + call s:check_tab(1, '.+1tab help', 3) + call s:check_tab(1, '0tab help', 1) + call s:check_tab(2, '+tab help', 4) + call s:check_tab(2, '+2tab help', 5) + call s:check_tab(4, '-tab help', 4) + call s:check_tab(4, '-2tab help', 3) + call s:check_tab(3, '$tab help', 6) + call assert_fails('99tab help', 'E16:') + call assert_fails('+99tab help', 'E16:') + call assert_fails('-99tab help', 'E16:') + + delfunction s:check_tab + tabonly! + bw! +endfunction + " vim: shiftwidth=2 sts=2 expandtab -- cgit From c5c8a821341b71ae29786c97df7930a9581f7ab7 Mon Sep 17 00:00:00 2001 From: Grzegorz Milka Date: Sun, 23 Oct 2016 00:25:16 +0200 Subject: vim-patch:7.4.2309 Problem: Crash when doing tabnext in a BufUnload autocmd. (Dominique Pelle) Solution: When detecting that the tab page changed, don't just abort but delete the window where w_buffer is NULL. https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743 --- src/nvim/testdir/test_tabpage.vim | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_tabpage.vim b/src/nvim/testdir/test_tabpage.vim index f1c41e967b..7bdea0b186 100644 --- a/src/nvim/testdir/test_tabpage.vim +++ b/src/nvim/testdir/test_tabpage.vim @@ -218,4 +218,18 @@ function Test_tabpage_with_tab_modifier() bw! endfunction +func Test_tabnext_on_buf_unload() + " This once caused a crash + new + tabedit + tabfirst + au BufUnload tabnext + q + + while tabpagenr('$') > 1 + quit + endwhile +endfunc + + " vim: shiftwidth=2 sts=2 expandtab -- cgit From 26b90e95e7bfa8bec29d33642c80dd5c55ff88a7 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Wed, 26 Oct 2016 13:53:14 +0200 Subject: test: Add missing test from vim-patch:7.4.2312 --- src/nvim/testdir/test_tabpage.vim | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_tabpage.vim b/src/nvim/testdir/test_tabpage.vim index 7bdea0b186..0bf7d056de 100644 --- a/src/nvim/testdir/test_tabpage.vim +++ b/src/nvim/testdir/test_tabpage.vim @@ -218,7 +218,7 @@ function Test_tabpage_with_tab_modifier() bw! endfunction -func Test_tabnext_on_buf_unload() +func Test_tabnext_on_buf_unload1() " This once caused a crash new tabedit @@ -227,7 +227,19 @@ func Test_tabnext_on_buf_unload() q while tabpagenr('$') > 1 - quit + bwipe! + endwhile +endfunc + +func Test_tabnext_on_buf_unload2() + " This once caused a crash + tabedit + autocmd BufUnload tabnext + file x + edit y + + while tabpagenr('$') > 1 + bwipe! endwhile endfunc -- cgit