4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: Possible hang for deleting auto-indent. (Dominique Pelle)
12 Solution: Make sure the position is not beyond the end of the line.
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
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)))
27 pos_T tpos = curwin->w_cursor;
29 curwin->w_cursor = *end_insert_pos;
32 if (gchar_cursor() == NUL && curwin->w_cursor.col > 0)
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)
44 pos_T tpos = curwin->w_cursor;
46 curwin->w_cursor = *end_insert_pos;
47 + check_cursor_col(); /* make sure it is not past the line */
50 if (gchar_cursor() == NUL && curwin->w_cursor.col > 0)
56 ! (void)del_char(TRUE);
58 if (curwin->w_cursor.lnum != tpos.lnum)
59 curwin->w_cursor = tpos;
64 ! if (del_char(TRUE) == FAIL)
65 ! break; /* should not happen */
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
74 { /* Add new patch number below this line */
80 FIRST VILLAGER: We have found a witch. May we burn her?
81 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
83 /// Bram Moolenaar -- Bram@Moolenaar.net -- 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 ///