| To: vim-dev@vim.org |
| Subject: Patch 7.0.042 |
| Fcc: outbox |
| From: Bram Moolenaar <Bram@moolenaar.net> |
| Mime-Version: 1.0 |
| Content-Type: text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding: 8bit |
| |
| |
| Patch 7.0.042 |
| Problem: When pasting a block of text in Insert mode Vim hangs or crashes. |
| (Noam Halevy) |
| Solution: Avoid that the cursor is positioned past the NUL of a line. |
| Files: src/ops.c |
| |
| |
| |
| |
| |
| *** 3493,3500 **** |
| --- 3493,3507 ---- |
| # endif |
| if (flags & PUT_CURSEND) |
| { |
| + colnr_T len; |
| + |
| curwin->w_cursor = curbuf->b_op_end; |
| curwin->w_cursor.col++; |
| + |
| + /* in Insert mode we might be after the NUL, correct for that */ |
| + len = (colnr_T)STRLEN(ml_get_curline()); |
| + if (curwin->w_cursor.col > len) |
| + curwin->w_cursor.col = len; |
| } |
| else |
| curwin->w_cursor.lnum = lnum; |
| |
| |
| |
| *** 668,669 **** |
| --- 668,671 ---- |
| { /* Add new patch number below this line */ |
| + /**/ |
| + 42, |
| /**/ |
| |
| -- |
| hundred-and-one symptoms of being an internet addict: |
| 45. You buy a Captain Kirk chair with a built-in keyboard and mouse. |
| |
| /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ |
| /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ |
| \\\ download, build and distribute -- http://www.A-A-P.org /// |
| \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |