To: vim-dev@vim.org Subject: Patch 6.2.330 (extra) Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.2.331 (after 6.2.327) Problem: "gwap" leaves cursor in the wrong line. Solution: Remember the cursor position before finding the ends of the paragraph. Files: src/normal.c, src/ops.c, src/structs.h *** ../vim-6.2.330/src/normal.c Mon Mar 8 12:27:39 2004 --- src/normal.c Tue Mar 9 11:41:22 2004 *************** *** 7288,7295 **** * "gU" Change text to upper case. * "g?" rot13 encoding */ - case 'q': case 'w': case '~': case 'u': case 'U': --- 7291,7300 ---- * "gU" Change text to upper case. * "g?" rot13 encoding */ case 'w': + oap->cursor_start = curwin->w_cursor; + /*FALLTHROUGH*/ + case 'q': case '~': case 'u': case 'U': *** ../vim-6.2.330/src/ops.c Mon Mar 8 12:27:39 2004 --- src/ops.c Tue Mar 9 11:44:28 2004 *************** *** 4066,4072 **** curbuf->b_op_start = oap->start; if (keep_cursor) ! saved_cursor = curwin->w_cursor; format_lines(oap->line_count); --- 4066,4072 ---- curbuf->b_op_start = oap->start; if (keep_cursor) ! saved_cursor = oap->cursor_start; format_lines(oap->line_count); *** ../vim-6.2.330/src/structs.h Mon Mar 8 12:27:39 2004 --- src/structs.h Tue Mar 9 12:40:34 2004 *************** *** 1602,1607 **** --- 1602,1608 ---- do_format()) */ pos_T start; /* start of the operator */ pos_T end; /* end of the operator */ + pos_T cursor_start; /* cursor position before motion for "gw" */ long line_count; /* number of lines from op_start to op_end (inclusive) */ *** ../vim-6.2.330/src/version.c Tue Mar 9 10:48:23 2004 --- src/version.c Tue Mar 9 12:28:30 2004 *************** *** 639,640 **** --- 639,642 ---- { /* Add new patch number below this line */ + /**/ + 331, /**/ -- ARTHUR: What are you going to do. bleed on me? "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///