aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-02-09 22:08:57 -0500
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-02-10 17:54:24 -0500
commit787446886f4ca546afb07faf06556e75dbd4b6aa (patch)
tree60fa7d68906f737bcde340f119363a2d499c9faf /src/nvim/testdir
parentbe981112b8949506d05d6e38f23cd8976b8133c6 (diff)
downloadrneovim-787446886f4ca546afb07faf06556e75dbd4b6aa.tar.gz
rneovim-787446886f4ca546afb07faf06556e75dbd4b6aa.tar.bz2
rneovim-787446886f4ca546afb07faf06556e75dbd4b6aa.zip
vim-patch:8.1.0341: :argadd in empty buffer changes the buffer name
Problem: :argadd in empty buffer changes the buffer name. (Pavol Juhas) Solution: Don't re-use the current buffer when not going to edit the file. (closes vim/vim#3397) Do re-use the current buffer for :next. https://github.com/vim/vim/commit/32bbd00949c585ea1c9da13197279a175097eddd
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_arglist.vim18
-rw-r--r--src/nvim/testdir/test_command_count.vim4
2 files changed, 21 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_arglist.vim b/src/nvim/testdir/test_arglist.vim
index 92fedf9bfb..a1ef8325ec 100644
--- a/src/nvim/testdir/test_arglist.vim
+++ b/src/nvim/testdir/test_arglist.vim
@@ -80,6 +80,24 @@ func Test_argadd()
call assert_equal(0, len(argv()))
endfunc
+func Test_argadd_empty_curbuf()
+ new
+ let curbuf = bufnr('%')
+ call writefile(['test', 'Xargadd'], 'Xargadd')
+ " must not re-use the current buffer.
+ argadd Xargadd
+ call assert_equal(curbuf, bufnr('%'))
+ call assert_equal('', bufname('%'))
+ call assert_equal(1, line('$'))
+ rew
+ call assert_notequal(curbuf, bufnr('%'))
+ call assert_equal('Xargadd', bufname('%'))
+ call assert_equal(2, line('$'))
+
+ %argd
+ bwipe!
+endfunc
+
func Init_abc()
args a b c
next
diff --git a/src/nvim/testdir/test_command_count.vim b/src/nvim/testdir/test_command_count.vim
index 7262789ab4..55b230373f 100644
--- a/src/nvim/testdir/test_command_count.vim
+++ b/src/nvim/testdir/test_command_count.vim
@@ -158,7 +158,9 @@ endfunc
func Test_command_count_4()
%argd
let bufnr = bufnr('$')
- arga aa bb cc dd ee ff
+ next aa bb cc dd ee ff
+ call assert_equal(bufnr, bufnr('%'))
+
3argu
let args = []
.,$-argdo call add(args, expand('%'))