aboutsummaryrefslogtreecommitdiff
path: root/test/old/testdir/test_excmd.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-01-24 07:29:33 +0800
committerGitHub <noreply@github.com>2024-01-24 07:29:33 +0800
commit65bfa86efeeb2ec18ba82fd821ffd4c8f97fcd2b (patch)
treebf5999ea603cd484c19148687a0dd83c0d8fecc1 /test/old/testdir/test_excmd.vim
parent6cbfe454542ff498a84b22f0aff1bf215e883485 (diff)
downloadrneovim-65bfa86efeeb2ec18ba82fd821ffd4c8f97fcd2b.tar.gz
rneovim-65bfa86efeeb2ec18ba82fd821ffd4c8f97fcd2b.tar.bz2
rneovim-65bfa86efeeb2ec18ba82fd821ffd4c8f97fcd2b.zip
vim-patch:9.1.0046: :drop does not re-use empty buffer (#27165)
Problem: :drop does not re-use empty buffer (Rocco Mao) Solution: Make :drop re-use an empty buffer (Rocco Mao) fixes: vim/vim#13851 closes: vim/vim#13881 https://github.com/vim/vim/commit/f96dc8d07f752ddd96d1447d85278a85255a1462 Co-authored-by: Rocco Mao <dapeng.mao@qq.com>
Diffstat (limited to 'test/old/testdir/test_excmd.vim')
-rw-r--r--test/old/testdir/test_excmd.vim22
1 files changed, 15 insertions, 7 deletions
diff --git a/test/old/testdir/test_excmd.vim b/test/old/testdir/test_excmd.vim
index c729ff4929..b7356c22fa 100644
--- a/test/old/testdir/test_excmd.vim
+++ b/test/old/testdir/test_excmd.vim
@@ -90,23 +90,31 @@ endfunc
" Test for the :drop command
func Test_drop_cmd()
- call writefile(['L1', 'L2'], 'Xfile')
+ call writefile(['L1', 'L2'], 'Xdropfile', 'D')
+ " Test for reusing the current buffer
enew | only
- drop Xfile
+ let expected_nr = bufnr()
+ drop Xdropfile
+ call assert_equal(expected_nr, bufnr())
call assert_equal('L2', getline(2))
" Test for switching to an existing window
below new
- drop Xfile
+ drop Xdropfile
call assert_equal(1, winnr())
- " Test for splitting the current window
+ " Test for splitting the current window (set nohidden)
enew | only
set modified
- drop Xfile
+ drop Xdropfile
call assert_equal(2, winnr('$'))
+ " Not splitting the current window even if modified (set hidden)
+ set hidden
+ enew | only
+ set modified
+ drop Xdropfile
+ call assert_equal(1, winnr('$'))
" Check for setting the argument list
- call assert_equal(['Xfile'], argv())
+ call assert_equal(['Xdropfile'], argv())
enew | only!
- call delete('Xfile')
endfunc
" Test for the :append command