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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user