]>
Commit | Line | Data |
---|---|---|
7a7a4b06 | 1 | To: vim-dev@vim.org |
2 | Subject: Patch 7.0.042 | |
3 | Fcc: outbox | |
4 | From: Bram Moolenaar <Bram@moolenaar.net> | |
5 | Mime-Version: 1.0 | |
6 | Content-Type: text/plain; charset=ISO-8859-1 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ------------ | |
9 | ||
10 | Patch 7.0.042 | |
11 | Problem: When pasting a block of text in Insert mode Vim hangs or crashes. | |
12 | (Noam Halevy) | |
13 | Solution: Avoid that the cursor is positioned past the NUL of a line. | |
14 | Files: src/ops.c | |
15 | ||
16 | ||
17 | *** ../vim-7.0.041/src/ops.c Tue Jun 20 20:29:13 2006 | |
18 | --- src/ops.c Sun Jul 23 22:36:39 2006 | |
19 | *************** | |
20 | *** 3493,3500 **** | |
21 | --- 3493,3507 ---- | |
22 | # endif | |
23 | if (flags & PUT_CURSEND) | |
24 | { | |
25 | + colnr_T len; | |
26 | + | |
27 | curwin->w_cursor = curbuf->b_op_end; | |
28 | curwin->w_cursor.col++; | |
29 | + | |
30 | + /* in Insert mode we might be after the NUL, correct for that */ | |
31 | + len = (colnr_T)STRLEN(ml_get_curline()); | |
32 | + if (curwin->w_cursor.col > len) | |
33 | + curwin->w_cursor.col = len; | |
34 | } | |
35 | else | |
36 | curwin->w_cursor.lnum = lnum; | |
37 | *** ../vim-7.0.041/src/version.c Sun Jul 23 22:07:55 2006 | |
38 | --- src/version.c Sun Jul 23 22:35:13 2006 | |
39 | *************** | |
40 | *** 668,669 **** | |
41 | --- 668,671 ---- | |
42 | { /* Add new patch number below this line */ | |
43 | + /**/ | |
44 | + 42, | |
45 | /**/ | |
46 | ||
47 | -- | |
48 | hundred-and-one symptoms of being an internet addict: | |
49 | 45. You buy a Captain Kirk chair with a built-in keyboard and mouse. | |
50 | ||
51 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
52 | /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
53 | \\\ download, build and distribute -- http://www.A-A-P.org /// | |
54 | \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |