From 5e80b90ef46cdd316b9da9543cd6a80a92259ffb Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 21 Dec 2020 19:03:40 -0500 Subject: vim-patch:8.2.2176: crash with a sequence of fold commands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: Crash with a sequence of fold commands. Solution: Bail out when there are no folds at all. Add a test (Dominique Pellé) (closes vim/vim#7515) https://github.com/vim/vim/commit/6a78f328442073c32d58eafc13ce5a1ca7729eeb N/A patches for version.c: vim-patch:8.2.2174: Mac version doesn't specify the CPU architecture Problem: Mac version doesn't specify the CPU architecture. Solution: Add "arm64" or "x86_64". (Yee Cheng Chin, closes vim/vim#7519) https://github.com/vim/vim/commit/8c9d98a8af5351a3ac98cf11dede9f0268461511 vim-patch:8.2.2175: github actions: clang-11 handling suboptimal Problem: Github actions: clang-11 handling suboptimal. Solution: Separate step of installing clang-11. Get ubuntu release name dynamically. (Ozaki Kiichi, closes vim/vim#7514) https://github.com/vim/vim/commit/9aff970204234193045cfee205d51e2393e93bfd --- src/nvim/fold.c | 3 ++- src/nvim/testdir/test_fold.vim | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/nvim/fold.c b/src/nvim/fold.c index 654aa6d5ba..0593c16999 100644 --- a/src/nvim/fold.c +++ b/src/nvim/fold.c @@ -902,8 +902,9 @@ int foldMoveTo( bool last = false; for (;; ) { if (!foldFind(gap, curwin->w_cursor.lnum - lnum_off, &fp)) { - if (!updown) + if (!updown || gap->ga_len == 0) { break; + } /* When moving up, consider a fold above the cursor; when * moving down consider a fold below the cursor. */ diff --git a/src/nvim/testdir/test_fold.vim b/src/nvim/testdir/test_fold.vim index 3c90c45952..88ce64b9eb 100644 --- a/src/nvim/testdir/test_fold.vim +++ b/src/nvim/testdir/test_fold.vim @@ -815,4 +815,11 @@ func Test_fold_create_delete_create() bwipe! endfunc +" this was crashing +func Test_fold_create_delete() + new + norm zFzFzdzj + bwipe! +endfunc + " vim: shiftwidth=2 sts=2 expandtab -- cgit