astepano / rpms / vim

Forked from rpms/vim 6 years ago
Clone
0019b2d
To: vim_dev@googlegroups.com
0019b2d
Subject: Patch 7.3.356
0019b2d
Fcc: outbox
0019b2d
From: Bram Moolenaar <Bram@moolenaar.net>
0019b2d
Mime-Version: 1.0
0019b2d
Content-Type: text/plain; charset=UTF-8
0019b2d
Content-Transfer-Encoding: 8bit
0019b2d
------------
0019b2d
0019b2d
Patch 7.3.356
0019b2d
Problem:    Using "o" with 'cindent' set may freeze Vim. (lolilolicon)
0019b2d
Solution:   Skip over {} correctly. (Hari G)
0019b2d
Files:	    src/misc1.c
0019b2d
0019b2d
0019b2d
*** ../vim-7.3.355/src/misc1.c	2011-10-04 18:03:43.000000000 +0200
0019b2d
--- src/misc1.c	2011-11-30 12:56:55.000000000 +0100
0019b2d
***************
0019b2d
*** 6127,6133 ****
0019b2d
  
0019b2d
  /*
0019b2d
   * Set w_cursor.col to the column number of the last unmatched ')' or '{' in
0019b2d
!  * line "l".
0019b2d
   */
0019b2d
      static int
0019b2d
  find_last_paren(l, start, end)
0019b2d
--- 6127,6133 ----
0019b2d
  
0019b2d
  /*
0019b2d
   * Set w_cursor.col to the column number of the last unmatched ')' or '{' in
0019b2d
!  * line "l".  "l" must point to the start of the line.
0019b2d
   */
0019b2d
      static int
0019b2d
  find_last_paren(l, start, end)
0019b2d
***************
0019b2d
*** 6140,6146 ****
0019b2d
  
0019b2d
      curwin->w_cursor.col = 0;		    /* default is start of line */
0019b2d
  
0019b2d
!     for (i = 0; l[i]; i++)
0019b2d
      {
0019b2d
  	i = (int)(cin_skipcomment(l + i) - l); /* ignore parens in comments */
0019b2d
  	i = (int)(skip_string(l + i) - l);    /* ignore parens in quotes */
0019b2d
--- 6140,6146 ----
0019b2d
  
0019b2d
      curwin->w_cursor.col = 0;		    /* default is start of line */
0019b2d
  
0019b2d
!     for (i = 0; l[i] != NUL; i++)
0019b2d
      {
0019b2d
  	i = (int)(cin_skipcomment(l + i) - l); /* ignore parens in comments */
0019b2d
  	i = (int)(skip_string(l + i) - l);    /* ignore parens in quotes */
0019b2d
***************
0019b2d
*** 7953,7958 ****
0019b2d
--- 7953,7959 ----
0019b2d
  			 * If we're at the end of a block, skip to the start of
0019b2d
  			 * that block.
0019b2d
  			 */
0019b2d
+ 			l = ml_get_curline();
0019b2d
  			if (find_last_paren(l, '{', '}')
0019b2d
  				&& (trypos = find_start_brace(ind_maxcomment))
0019b2d
  							    != NULL) /* XXX */
0019b2d
*** ../vim-7.3.355/src/version.c	2011-11-30 11:31:25.000000000 +0100
0019b2d
--- src/version.c	2011-11-30 13:02:52.000000000 +0100
0019b2d
***************
0019b2d
*** 716,717 ****
0019b2d
--- 716,719 ----
0019b2d
  {   /* Add new patch number below this line */
0019b2d
+ /**/
0019b2d
+     356,
0019b2d
  /**/
0019b2d
0019b2d
-- 
0019b2d
hundred-and-one symptoms of being an internet addict:
0019b2d
213. Your kids start referring to you as "that guy in front of the monitor."
0019b2d
0019b2d
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
0019b2d
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
0019b2d
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
0019b2d
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///