neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit ab7bd119d7788cbf6735f4ca439246f07aa73911
parent a2f4bad781efd6c011dc93845fce342b6477162d
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Wed, 19 Apr 2023 11:09:34 +0800

vim-patch:9.0.1012: tests may get stuck in buffer with swap file

Problem:    Tests may get stuck in buffer with swap file.
Solution:   Bail out when bwipe! doesn't get another buffer.

https://github.com/vim/vim/commit/fa2533c8bb96abcec29b9dc6bd4fe7054c7c7e50

Co-authored-by: Bram Moolenaar <Bram@vim.org>

Diffstat:
Mtest/old/testdir/runtest.vim | 9++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/test/old/testdir/runtest.vim b/test/old/testdir/runtest.vim @@ -323,7 +323,14 @@ func RunTheTest(test) " buffer, continue until we end up in an empty no-name buffer without a swap " file. while bufname() != '' || execute('swapname') !~ 'No swap file' - bwipe! + let bn = bufnr() + + noswapfile bwipe! + + if bn == bufnr() + " avoid getting stuck in the same buffer + break + endif endwhile " Check if the test has left any swap files behind. Delete them before