Karsten Hopp 47f669
To: vim_dev@googlegroups.com
Karsten Hopp 47f669
Subject: Patch 7.3.637
Karsten Hopp 47f669
Fcc: outbox
Karsten Hopp 47f669
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 47f669
Mime-Version: 1.0
Karsten Hopp 47f669
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 47f669
Content-Transfer-Encoding: 8bit
Karsten Hopp 47f669
------------
Karsten Hopp 47f669
Karsten Hopp 47f669
Patch 7.3.637
Karsten Hopp 47f669
Problem:    Cannot catch the error caused by a foldopen when there is no fold.
Karsten Hopp 47f669
	    (ZyX, Issue 48)
Karsten Hopp 47f669
Solution:   Do not break out of the loop early when inside try/catch.
Karsten Hopp 47f669
	    (Christian Brabandt) Except when there is a syntax error.
Karsten Hopp 47f669
Files:	    src/ex_docmd.c, src/globals.h
Karsten Hopp 47f669
Karsten Hopp 47f669
Karsten Hopp 47f669
*** ../vim-7.3.636/src/ex_docmd.c	2012-08-15 14:04:50.000000000 +0200
Karsten Hopp 47f669
--- src/ex_docmd.c	2012-08-23 18:39:08.000000000 +0200
Karsten Hopp 47f669
***************
Karsten Hopp 47f669
*** 1295,1301 ****
Karsten Hopp 47f669
  		&& cstack.cs_trylevel == 0
Karsten Hopp 47f669
  #endif
Karsten Hopp 47f669
  	    )
Karsten Hopp 47f669
! 	    && !(did_emsg && used_getline
Karsten Hopp 47f669
  			    && (getline_equal(fgetline, cookie, getexmodeline)
Karsten Hopp 47f669
  			       || getline_equal(fgetline, cookie, getexline)))
Karsten Hopp 47f669
  	    && (next_cmdline != NULL
Karsten Hopp 47f669
--- 1295,1308 ----
Karsten Hopp 47f669
  		&& cstack.cs_trylevel == 0
Karsten Hopp 47f669
  #endif
Karsten Hopp 47f669
  	    )
Karsten Hopp 47f669
! 	    && !(did_emsg
Karsten Hopp 47f669
! #ifdef FEAT_EVAL
Karsten Hopp 47f669
! 		/* Keep going when inside try/catch, so that the error can be
Karsten Hopp 47f669
! 		 * dealth with, except when it is a syntax error, it may cause
Karsten Hopp 47f669
! 		 * the :endtry to be missed. */
Karsten Hopp 47f669
! 		&& (cstack.cs_trylevel == 0 || did_emsg_syntax)
Karsten Hopp 47f669
! #endif
Karsten Hopp 47f669
! 		&& used_getline
Karsten Hopp 47f669
  			    && (getline_equal(fgetline, cookie, getexmodeline)
Karsten Hopp 47f669
  			       || getline_equal(fgetline, cookie, getexline)))
Karsten Hopp 47f669
  	    && (next_cmdline != NULL
Karsten Hopp 47f669
***************
Karsten Hopp 47f669
*** 1305,1310 ****
Karsten Hopp 47f669
--- 1312,1318 ----
Karsten Hopp 47f669
  			|| (flags & DOCMD_REPEAT)));
Karsten Hopp 47f669
  
Karsten Hopp 47f669
      vim_free(cmdline_copy);
Karsten Hopp 47f669
+     did_emsg_syntax = FALSE;
Karsten Hopp 47f669
  #ifdef FEAT_EVAL
Karsten Hopp 47f669
      free_cmdlines(&lines_ga);
Karsten Hopp 47f669
      ga_clear(&lines_ga);
Karsten Hopp 47f669
***************
Karsten Hopp 47f669
*** 2137,2142 ****
Karsten Hopp 47f669
--- 2145,2151 ----
Karsten Hopp 47f669
  	    if (!sourcing)
Karsten Hopp 47f669
  		append_command(*cmdlinep);
Karsten Hopp 47f669
  	    errormsg = IObuff;
Karsten Hopp 47f669
+ 	    did_emsg_syntax = TRUE;
Karsten Hopp 47f669
  	}
Karsten Hopp 47f669
  	goto doend;
Karsten Hopp 47f669
      }
Karsten Hopp 47f669
*** ../vim-7.3.636/src/globals.h	2012-07-10 16:49:08.000000000 +0200
Karsten Hopp 47f669
--- src/globals.h	2012-08-23 18:29:09.000000000 +0200
Karsten Hopp 47f669
***************
Karsten Hopp 47f669
*** 183,188 ****
Karsten Hopp 47f669
--- 183,190 ----
Karsten Hopp 47f669
  #endif
Karsten Hopp 47f669
  EXTERN int	did_emsg;		    /* set by emsg() when the message
Karsten Hopp 47f669
  					       is displayed or thrown */
Karsten Hopp 47f669
+ EXTERN int	did_emsg_syntax;	    /* did_emsg set because of a
Karsten Hopp 47f669
+ 					       syntax error */
Karsten Hopp 47f669
  EXTERN int	called_emsg;		    /* always set by emsg() */
Karsten Hopp 47f669
  EXTERN int	ex_exitval INIT(= 0);	    /* exit value for ex mode */
Karsten Hopp 47f669
  EXTERN int	emsg_on_display INIT(= FALSE);	/* there is an error message */
Karsten Hopp 47f669
*** ../vim-7.3.636/src/version.c	2012-08-23 15:53:00.000000000 +0200
Karsten Hopp 47f669
--- src/version.c	2012-08-23 17:59:12.000000000 +0200
Karsten Hopp 47f669
***************
Karsten Hopp 47f669
*** 721,722 ****
Karsten Hopp 47f669
--- 721,724 ----
Karsten Hopp 47f669
  {   /* Add new patch number below this line */
Karsten Hopp 47f669
+ /**/
Karsten Hopp 47f669
+     637,
Karsten Hopp 47f669
  /**/
Karsten Hopp 47f669
Karsten Hopp 47f669
-- 
Karsten Hopp 47f669
GOD: That is your purpose Arthur ... the Quest for the Holy Grail ...
Karsten Hopp 47f669
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
Karsten Hopp 47f669
Karsten Hopp 47f669
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 47f669
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 47f669
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 47f669
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///