To: vim-dev@vim.org Subject: Patch 6.1.252 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.252 Problem: "vi}" does not include a line break when the "}" is at the start of a following line. (Kamil Burzynski) Solution: Include the line break. Files: src/search.c *** ../vim61.251/src/search.c Tue Aug 13 21:35:32 2002 --- src/search.c Mon Nov 4 19:47:37 2002 *************** *** 3077,3082 **** --- 3077,3083 ---- pos_T *end_pos; pos_T old_start, old_end; char_u *save_cpo; + int sol = FALSE; /* { at start of line */ old_pos = curwin->w_cursor; old_end = curwin->w_cursor; /* remember where we started */ *************** *** 3142,3152 **** --- 3143,3157 ---- while (!include) { incl(&start_pos); + sol = (curwin->w_cursor.col == 0); decl(&curwin->w_cursor); if (what == '{') while (inindent(1)) + { + sol = TRUE; if (decl(&curwin->w_cursor) != 0) break; + } #ifdef FEAT_VISUAL /* * In Visual mode, when the resulting area is not bigger than what we *************** *** 3181,3186 **** --- 3186,3193 ---- { if (*p_sel == 'e') ++curwin->w_cursor.col; + if (sol) + inc(&curwin->w_cursor); /* include the line break */ VIsual = start_pos; VIsual_mode = 'v'; redraw_curbuf_later(INVERTED); /* update the inversion */ *************** *** 3191,3197 **** { oap->start = start_pos; oap->motion_type = MCHAR; ! oap->inclusive = TRUE; } return OK; --- 3198,3210 ---- { oap->start = start_pos; oap->motion_type = MCHAR; ! if (sol) ! { ! incl(&curwin->w_cursor); ! oap->inclusive = FALSE; ! } ! else ! oap->inclusive = TRUE; } return OK; *** ../vim61.251/src/version.c Mon Nov 11 21:25:36 2002 --- src/version.c Mon Nov 11 21:27:29 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 252, /**/ -- login: yes password: I don't know, please tell me password is incorrect login: yes password: incorrect /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.vim.org \\\ \\\ Project leader for A-A-P -- http://www.a-a-p.org /// \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///