From ab7bd119d7788cbf6735f4ca439246f07aa73911 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 19 Apr 2023 11:09:34 +0800 Subject: 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 --- test/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 index 5fda5bb440..935d033e4e 100644 --- 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 -- cgit