To: vim_dev@googlegroups.com Subject: Patch 8.2.1947 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1947 Problem: Crash when using "zj" without folds. (Sean Dewar) Solution: Check for at least one fold. (closes #7245) Files: src/fold.c, src/testdir/test_fold.vim *** ../vim-8.2.1946/src/fold.c 2020-09-17 19:35:53.646187488 +0200 --- src/fold.c 2020-11-03 20:03:07.515107938 +0100 *************** *** 902,907 **** --- 902,909 ---- // that moves the cursor is used. lnum_off = 0; gap = &curwin->w_folds; + if (gap->ga_len == 0) + break; use_level = FALSE; maybe_small = FALSE; lnum_found = curwin->w_cursor.lnum; *** ../vim-8.2.1946/src/testdir/test_fold.vim 2020-09-17 19:35:53.646187488 +0200 --- src/testdir/test_fold.vim 2020-11-03 20:02:41.299170854 +0100 *************** *** 835,838 **** --- 835,847 ---- bwipe! endfunc + " this was crashing + func Test_move_no_folds() + new + fold + setlocal fdm=expr + normal zj + bwipe! + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.1946/src/version.c 2020-11-03 18:51:50.505968361 +0100 --- src/version.c 2020-11-03 20:05:09.862813527 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 1947, /**/ -- hundred-and-one symptoms of being an internet addict: 188. You purchase a laptop so you can surf while sitting on the can. /// 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 ///