0
0
mirror of https://github.com/vim/vim.git synced 2025-10-31 09:57:14 -04:00

updated for version 7.3.456

Problem:    ":tab drop file" has several problems, including moving the
            current window and opening a new tab for a file that already has a
            window.
Solution:   Refactor ":tab drop" handling. (Hirohito Higashi)
This commit is contained in:
Bram Moolenaar
2012-02-22 19:13:08 +01:00
parent b549a731fb
commit 52379eadfb
4 changed files with 108 additions and 24 deletions

View File

@@ -50,6 +50,43 @@ STARTTEST
:call append(line('$'), test_status)
:"
:"
:" Test for ":tab drop exist-file" to keep current window.
:sp test1
:tab drop test1
:let test_status = 'tab drop 1: fail'
:if tabpagenr('$') == 1 && winnr('$') == 2 && winnr() == 1
: let test_status = 'tab drop 1: pass'
:endif
:close
:call append(line('$'), test_status)
:"
:"
:" Test for ":tab drop new-file" to keep current window of tabpage 1.
:split
:tab drop newfile
:let test_status = 'tab drop 2: fail'
:if tabpagenr('$') == 2 && tabpagewinnr(1, '$') == 2 && tabpagewinnr(1) == 1
: let test_status = 'tab drop 2: pass'
:endif
:tabclose
:q
:call append(line('$'), test_status)
:"
:"
:" Test for ":tab drop multi-opend-file" to keep current tabpage and window.
:new test1
:tabnew
:new test1
:tab drop test1
:let test_status = 'tab drop 3: fail'
:if tabpagenr() == 2 && tabpagewinnr(2, '$') == 2 && tabpagewinnr(2) == 1
: let test_status = 'tab drop 3: pass'
:endif
:tabclose
:q
:call append(line('$'), test_status)
:"
:"
:/^Results/,$w! test.out
:qa!
ENDTEST

View File

@@ -5,3 +5,6 @@ this is tab page 1
this is tab page 4
gettabvar: pass
settabvar: pass
tab drop 1: pass
tab drop 2: pass
tab drop 3: pass