1 To: [email protected] |
|
2 Subject: Patch 7.2.189 |
|
3 Fcc: outbox |
|
4 From: Bram Moolenaar <[email protected]> |
|
5 Mime-Version: 1.0 |
|
6 Content-Type: text/plain; charset=UTF-8 |
|
7 Content-Transfer-Encoding: 8bit |
|
8 ------------ |
|
9 |
|
10 Patch 7.2.189 |
|
11 Problem: Possible hang for deleting auto-indent. (Dominique Pelle) |
|
12 Solution: Make sure the position is not beyond the end of the line. |
|
13 Files: src/edit.c |
|
14 |
|
15 |
|
16 *** ../vim-7.2.188/src/edit.c 2009-05-16 16:36:25.000000000 +0200 |
|
17 --- src/edit.c 2009-05-26 10:53:05.000000000 +0200 |
|
18 *************** |
|
19 *** 6420,6432 **** |
|
20 |
|
21 /* If we just did an auto-indent, remove the white space from the end |
|
22 * of the line, and put the cursor back. |
|
23 ! * Do this when ESC was used or moving the cursor up/down. */ |
|
24 if (did_ai && (esc || (vim_strchr(p_cpo, CPO_INDENT) == NULL |
|
25 ! && curwin->w_cursor.lnum != end_insert_pos->lnum))) |
|
26 { |
|
27 pos_T tpos = curwin->w_cursor; |
|
28 |
|
29 curwin->w_cursor = *end_insert_pos; |
|
30 for (;;) |
|
31 { |
|
32 if (gchar_cursor() == NUL && curwin->w_cursor.col > 0) |
|
33 --- 6420,6436 ---- |
|
34 |
|
35 /* If we just did an auto-indent, remove the white space from the end |
|
36 * of the line, and put the cursor back. |
|
37 ! * Do this when ESC was used or moving the cursor up/down. |
|
38 ! * Check for the old position still being valid, just in case the text |
|
39 ! * got changed unexpectedly. */ |
|
40 if (did_ai && (esc || (vim_strchr(p_cpo, CPO_INDENT) == NULL |
|
41 ! && curwin->w_cursor.lnum != end_insert_pos->lnum)) |
|
42 ! && end_insert_pos->lnum <= curbuf->b_ml.ml_line_count) |
|
43 { |
|
44 pos_T tpos = curwin->w_cursor; |
|
45 |
|
46 curwin->w_cursor = *end_insert_pos; |
|
47 + check_cursor_col(); /* make sure it is not past the line */ |
|
48 for (;;) |
|
49 { |
|
50 if (gchar_cursor() == NUL && curwin->w_cursor.col > 0) |
|
51 *************** |
|
52 *** 6434,6440 **** |
|
53 cc = gchar_cursor(); |
|
54 if (!vim_iswhite(cc)) |
|
55 break; |
|
56 ! (void)del_char(TRUE); |
|
57 } |
|
58 if (curwin->w_cursor.lnum != tpos.lnum) |
|
59 curwin->w_cursor = tpos; |
|
60 --- 6438,6445 ---- |
|
61 cc = gchar_cursor(); |
|
62 if (!vim_iswhite(cc)) |
|
63 break; |
|
64 ! if (del_char(TRUE) == FAIL) |
|
65 ! break; /* should not happen */ |
|
66 } |
|
67 if (curwin->w_cursor.lnum != tpos.lnum) |
|
68 curwin->w_cursor = tpos; |
|
69 *** ../vim-7.2.188/src/version.c 2009-05-24 13:40:17.000000000 +0200 |
|
70 --- src/version.c 2009-05-26 10:50:53.000000000 +0200 |
|
71 *************** |
|
72 *** 678,679 **** |
|
73 --- 678,681 ---- |
|
74 { /* Add new patch number below this line */ |
|
75 + /**/ |
|
76 + 189, |
|
77 /**/ |
|
78 |
|
79 -- |
|
80 FIRST VILLAGER: We have found a witch. May we burn her? |
|
81 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD |
|
82 |
|
83 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ |
|
84 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ |
|
85 \\\ download, build and distribute -- http://www.A-A-P.org /// |
|
86 \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |
|