diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-08-31 23:06:22 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-08-31 23:06:22 +0200 |
commit | 32bbd00949c585ea1c9da13197279a175097eddd (patch) | |
tree | 62508b0ed6282faa5ceac0df0cbc7213893e6ce6 /src/testdir/test_arglist.vim | |
parent | 9049b686121367941bf534c041975938135c7e20 (diff) |
patch 8.1.0341: :argadd in empty buffer changes the buffer namev8.1.0341
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 #3397) Do re-use the current buffer for :next.
Diffstat (limited to 'src/testdir/test_arglist.vim')
-rw-r--r-- | src/testdir/test_arglist.vim | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/testdir/test_arglist.vim b/src/testdir/test_arglist.vim index 87bda700d1..a6c71c9f5f 100644 --- a/src/testdir/test_arglist.vim +++ b/src/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 |