To: vim_dev@googlegroups.com Subject: Patch 8.0.1417 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.1417 Problem: Test doesn't search for a sentence. Still fails when searching for start of sentence. (Dominique Pelle) Solution: Add paren. Check for MAXCOL in dec(). Files: src/testdir/test_search.vim, src/misc2.c *** ../vim-8.0.1416/src/testdir/test_search.vim 2017-12-19 21:23:16.813960405 +0100 --- src/testdir/test_search.vim 2017-12-19 22:19:33.120208599 +0100 *************** *** 733,738 **** func Test_search_sentence() new " this used to cause a crash ! call assert_fails("/\\%'", 'E486') call assert_fails("/", 'E486') endfunc --- 733,740 ---- func Test_search_sentence() new " this used to cause a crash ! call assert_fails("/\\%')", 'E486') call assert_fails("/", 'E486') + /\%'( + / endfunc *** ../vim-8.0.1416/src/misc2.c 2017-12-19 21:23:16.813960405 +0100 --- src/misc2.c 2017-12-19 22:17:24.340515172 +0100 *************** *** 417,424 **** #ifdef FEAT_VIRTUALEDIT lp->coladd = 0; #endif ! if (lp->col > 0) /* still within line */ { lp->col--; #ifdef FEAT_MBYTE if (has_mbyte) --- 417,437 ---- #ifdef FEAT_VIRTUALEDIT lp->coladd = 0; #endif ! if (lp->col == MAXCOL) { + /* past end of line */ + p = ml_get(lp->lnum); + lp->col = (colnr_T)STRLEN(p); + #ifdef FEAT_MBYTE + if (has_mbyte) + lp->col -= (*mb_head_off)(p, p + lp->col); + #endif + return 0; + } + + if (lp->col > 0) + { + /* still within line */ lp->col--; #ifdef FEAT_MBYTE if (has_mbyte) *************** *** 429,436 **** #endif return 0; } ! if (lp->lnum > 1) /* there is a prior line */ { lp->lnum--; p = ml_get(lp->lnum); lp->col = (colnr_T)STRLEN(p); --- 442,451 ---- #endif return 0; } ! ! if (lp->lnum > 1) { + /* there is a prior line */ lp->lnum--; p = ml_get(lp->lnum); lp->col = (colnr_T)STRLEN(p); *************** *** 440,446 **** #endif return 1; } ! return -1; /* at start of file */ } /* --- 455,463 ---- #endif return 1; } ! ! /* at start of file */ ! return -1; } /* *** ../vim-8.0.1416/src/version.c 2017-12-19 21:23:16.817960377 +0100 --- src/version.c 2017-12-19 22:20:41.476014877 +0100 *************** *** 773,774 **** --- 773,776 ---- { /* Add new patch number below this line */ + /**/ + 1417, /**/ -- "The sun oozed over the horizon, shoved aside darkness, crept along the greensward, and, with sickly fingers, pushed through the castle window, revealing the pillaged princess, hand at throat, crown asunder, gaping in frenzied horror at the sated, sodden amphibian lying beside her, disbelieving the magnitude of the frog's deception, screaming madly, "You lied!" - Winner of the Bulwer-Lytton contest (San Jose State University), wherein one writes only the first line of a bad novel /// 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 ///