4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Crash when indenting lines. (Dominique Pelle)
12 Solution: Set the cursor column when changing the cursor line.
13 Files: src/ops.c, src/misc1.c
16 *** ../vim-7.1.263/src/ops.c Wed Feb 6 14:43:50 2008
17 --- src/ops.c Sun Feb 24 14:56:38 2008
23 ++curwin->w_cursor.lnum;
24 + curwin->w_cursor.col = 0; /* make sure it's valid */
27 /* put cursor on first non-blank of indented line */
28 *** ../vim-7.1.263/src/misc1.c Wed Feb 13 10:57:11 2008
29 --- src/misc1.c Sun Feb 24 15:04:27 2008
35 curwin->w_cursor.lnum = trypos->lnum + 1;
36 + curwin->w_cursor.col = 0;
45 curwin->w_cursor.lnum = trypos->lnum + 1;
46 + curwin->w_cursor.col = 0;
53 if ((trypos = find_start_comment(ind_maxcomment)) != NULL)
55 curwin->w_cursor.lnum = trypos->lnum + 1;
56 + curwin->w_cursor.col = 0;
64 if (find_last_paren(l, '{', '}') && (trypos =
65 find_start_brace(ind_maxcomment)) != NULL)
67 curwin->w_cursor.lnum = trypos->lnum + 1;
68 + curwin->w_cursor.col = 0;
75 * case xx: if ( asdf &&
78 ! curwin->w_cursor.lnum = trypos->lnum;
80 if (cin_iscase(l) || cin_isscopedecl(l))
82 ++curwin->w_cursor.lnum;
87 * case xx: if ( asdf &&
90 ! curwin->w_cursor = *trypos;
92 if (cin_iscase(l) || cin_isscopedecl(l))
94 ++curwin->w_cursor.lnum;
95 + curwin->w_cursor.col = 0;
102 if (*l == NUL || l[STRLEN(l) - 1] != '\\')
104 --curwin->w_cursor.lnum;
105 + curwin->w_cursor.col = 0;
111 * case xx: if ( asdf &&
114 ! curwin->w_cursor.lnum = trypos->lnum;
115 l = ml_get_curline();
116 if (cin_iscase(l) || cin_isscopedecl(l))
118 ++curwin->w_cursor.lnum;
123 * case xx: if ( asdf &&
126 ! curwin->w_cursor = *trypos;
127 l = ml_get_curline();
128 if (cin_iscase(l) || cin_isscopedecl(l))
130 ++curwin->w_cursor.lnum;
131 + curwin->w_cursor.col = 0;
137 && (trypos = find_start_brace(ind_maxcomment))
140 ! curwin->w_cursor.lnum = trypos->lnum;
141 /* if not "else {" check for terminated again */
142 /* but skip block for "} else {" */
143 l = cin_skipcomment(ml_get_curline());
144 if (*l == '}' || !cin_iselse(l))
146 ++curwin->w_cursor.lnum;
151 && (trypos = find_start_brace(ind_maxcomment))
154 ! curwin->w_cursor = *trypos;
155 /* if not "else {" check for terminated again */
156 /* but skip block for "} else {" */
157 l = cin_skipcomment(ml_get_curline());
158 if (*l == '}' || !cin_iselse(l))
160 ++curwin->w_cursor.lnum;
161 + curwin->w_cursor.col = 0;
168 if ((trypos = find_start_comment(ind_maxcomment)) != NULL)
170 curwin->w_cursor.lnum = trypos->lnum + 1;
171 + curwin->w_cursor.col = 0;
177 if (find_last_paren(l, '(', ')')
178 && (trypos = find_match_paren(ind_maxparen,
179 ind_maxcomment)) != NULL)
180 ! curwin->w_cursor.lnum = trypos->lnum;
182 /* For a line ending in ',' that is a continuation line go
183 * back to the first line with a backslash:
185 if (find_last_paren(l, '(', ')')
186 && (trypos = find_match_paren(ind_maxparen,
187 ind_maxcomment)) != NULL)
188 ! curwin->w_cursor = *trypos;
190 /* For a line ending in ',' that is a continuation line go
191 * back to the first line with a backslash:
195 if (*l == NUL || l[STRLEN(l) - 1] != '\\')
197 --curwin->w_cursor.lnum;
198 + curwin->w_cursor.col = 0;
201 amount = get_indent(); /* XXX */
205 if ((trypos = find_match_paren(ind_maxparen,
206 ind_maxcomment)) != NULL)
207 ! curwin->w_cursor.lnum = trypos->lnum;
208 amount = get_indent(); /* XXX */
213 if ((trypos = find_match_paren(ind_maxparen,
214 ind_maxcomment)) != NULL)
215 ! curwin->w_cursor = *trypos;
216 amount = get_indent(); /* XXX */
219 *** ../vim-7.1.263/src/version.c Mon Feb 25 20:45:46 2008
220 --- src/version.c Mon Feb 25 21:51:20 2008
224 { /* Add new patch number below this line */
230 hundred-and-one symptoms of being an internet addict:
231 49. You never have to deal with busy signals when calling your ISP...because
234 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
235 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
236 \\\ download, build and distribute -- http://www.A-A-P.org ///
237 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///