]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.356 v7.3.356
authorBram Moolenaar <Bram@vim.org>
Wed, 30 Nov 2011 12:03:28 +0000 (13:03 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 30 Nov 2011 12:03:28 +0000 (13:03 +0100)
Problem:    Using "o" with 'cindent' set may freeze Vim. (lolilolicon)
Solution:   Skip over {} correctly. (Hari G)

src/misc1.c
src/version.c

index 95b45479c33a1aa8bfdde64446b18cf52b4f91f8..d260b0c2aab92a4c8afbe32d112ec661bc0fb92d 100644 (file)
@@ -6127,7 +6127,7 @@ corr_ind_maxparen(ind_maxparen, startpos)
 
 /*
  * Set w_cursor.col to the column number of the last unmatched ')' or '{' in
- * line "l".
+ * line "l".  "l" must point to the start of the line.
  */
     static int
 find_last_paren(l, start, end)
@@ -6140,7 +6140,7 @@ find_last_paren(l, start, end)
 
     curwin->w_cursor.col = 0;              /* default is start of line */
 
-    for (i = 0; l[i]; i++)
+    for (i = 0; l[i] != NUL; i++)
     {
        i = (int)(cin_skipcomment(l + i) - l); /* ignore parens in comments */
        i = (int)(skip_string(l + i) - l);    /* ignore parens in quotes */
@@ -7953,6 +7953,7 @@ term_again:
                         * If we're at the end of a block, skip to the start of
                         * that block.
                         */
+                       l = ml_get_curline();
                        if (find_last_paren(l, '{', '}')
                                && (trypos = find_start_brace(ind_maxcomment))
                                                            != NULL) /* XXX */
index 8496ef41a3070ca92e836f6ca982ad461687a25c..7a13d1315fc37905069c927dd70d5421390bac97 100644 (file)
@@ -714,6 +714,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    356,
 /**/
     355,
 /**/