From a8d0062c67953d9e024a09d3d6daf062aefca887 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Mon, 8 Apr 2019 19:50:36 +0200 Subject: vim-patch:8.0.1763: :argedit does not reuse an empty unnamed buffer Problem: :argedit does not reuse an empty unnamed buffer. Solution: Add the BLN_CURBUF flag and fix all the side effects. (Christian Brabandt) https://github.com/vim/vim/commit/46a53dfc29689c6a0d80e3820e8b0a48dba6b6ec --- src/nvim/testdir/test_arglist.vim | 12 ++++++++++++ src/nvim/testdir/test_command_count.vim | 1 - 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_arglist.vim b/src/nvim/testdir/test_arglist.vim index ae975fe137..3a9ffbdbf3 100644 --- a/src/nvim/testdir/test_arglist.vim +++ b/src/nvim/testdir/test_arglist.vim @@ -329,6 +329,18 @@ func Test_argedit() %argd bwipe! C bwipe! D + + " :argedit reuses the current buffer if it is empty + %argd + " make sure to use a new buffer number for x when it is loaded + bw! x + new + let a = bufnr('') + argedit x + call assert_equal(a, bufnr('')) + call assert_equal('x', bufname('')) + %argd + bw! x endfunc " Test for the :argdelete command diff --git a/src/nvim/testdir/test_command_count.vim b/src/nvim/testdir/test_command_count.vim index 2d793ed88f..7262789ab4 100644 --- a/src/nvim/testdir/test_command_count.vim +++ b/src/nvim/testdir/test_command_count.vim @@ -173,7 +173,6 @@ func Test_command_count_4() only! exe bufnr . 'buf' - bnext let bufnr = bufnr('%') let buffers = [] .,$-bufdo call add(buffers, bufnr('%')) -- cgit From 7381c93e2c0e7aa20d29cbc3c6c45de71e22a258 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Mon, 8 Apr 2019 20:00:41 +0200 Subject: vim-patch:8.1.1134: buffer for quickfix window is reused for another file Problem: Buffer for quickfix window is reused for another file. Solution: Don't reuse the quickfx buffer. (Yegappan Lakshmanan) https://github.com/vim/vim/commit/39803d82dbb215d2eea9fcd6cf2961b71515a438 --- src/nvim/testdir/test_quickfix.vim | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index cb3e7ca8f6..6227095f4f 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -2664,3 +2664,17 @@ func Test_qfwin_pos() call assert_equal(3, winnr()) close endfunc + +" Test to make sure that an empty quickfix buffer is not reused for loading +" a normal buffer. +func Test_empty_qfbuf() + enew | only + call writefile(["Test"], 'Xfile1') + call setqflist([], 'f') + copen | only + let qfbuf = bufnr('') + edit Xfile1 + call assert_notequal(qfbuf, bufnr('')) + enew + call delete('Xfile1') +endfunc -- cgit