To: vim_dev@googlegroups.com Subject: Patch 8.2.2176 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2176 Problem: Crash with a sequence of fold commands. Solution: Bail out when there are no folds at all. Add a test (Dominique Pellé) (closes #7515) Files: src/fold.c, src/testdir/test_fold.vim *** ../vim-8.2.2175/src/fold.c 2020-11-10 18:23:47.870506514 +0100 --- src/fold.c 2020-12-21 13:59:35.152948911 +0100 *************** *** 916,922 **** { if (!foldFind(gap, curwin->w_cursor.lnum - lnum_off, &fp)) { ! if (!updown) break; // When moving up, consider a fold above the cursor; when --- 916,922 ---- { if (!foldFind(gap, curwin->w_cursor.lnum - lnum_off, &fp)) { ! if (!updown || gap->ga_len == 0) break; // When moving up, consider a fold above the cursor; when *** ../vim-8.2.2175/src/testdir/test_fold.vim 2020-11-27 19:13:24.186184976 +0100 --- src/testdir/test_fold.vim 2020-12-21 13:53:42.662085303 +0100 *************** *** 852,855 **** --- 852,862 ---- bwipe! endfunc + " this was crashing + func Test_fold_create_delete() + new + norm zFzFzdzj + bwipe! + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.2175/src/version.c 2020-12-21 13:37:13.513191440 +0100 --- src/version.c 2020-12-21 13:54:45.345883759 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2176, /**/ -- Engineers are widely recognized as superior marriage material: intelligent, dependable, employed, honest, and handy around the house. (Scott Adams - The Dilbert principle) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///