Karsten Hopp 5cef0b
To: vim-dev@vim.org
Karsten Hopp 5cef0b
Subject: Patch 7.1.247
Karsten Hopp 5cef0b
Fcc: outbox
Karsten Hopp 5cef0b
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 5cef0b
Mime-Version: 1.0
Karsten Hopp 5cef0b
Content-Type: text/plain; charset=ISO-8859-1
Karsten Hopp 5cef0b
Content-Transfer-Encoding: 8bit
Karsten Hopp 5cef0b
------------
Karsten Hopp 5cef0b
Karsten Hopp 5cef0b
Patch 7.1.247
Karsten Hopp 5cef0b
Problem:    When using Netbeans backspacing in Insert mode skips a character
Karsten Hopp 5cef0b
	    now and then. (Ankit Jain)
Karsten Hopp 5cef0b
Solution:   Avoid calling netbeans_removed(), it frees the line pointer.
Karsten Hopp 5cef0b
	    (partly by Dominique Pelle).
Karsten Hopp 5cef0b
Files:	    src/misc1.c
Karsten Hopp 5cef0b
Karsten Hopp 5cef0b
Karsten Hopp 5cef0b
*** ../vim-7.1.246/src/misc1.c	Sat Jan 19 15:55:51 2008
Karsten Hopp 5cef0b
--- src/misc1.c	Wed Feb 13 10:56:16 2008
Karsten Hopp 5cef0b
***************
Karsten Hopp 5cef0b
*** 2270,2282 ****
Karsten Hopp 5cef0b
      /*
Karsten Hopp 5cef0b
       * If the old line has been allocated the deletion can be done in the
Karsten Hopp 5cef0b
       * existing line. Otherwise a new line has to be allocated
Karsten Hopp 5cef0b
       */
Karsten Hopp 5cef0b
-     was_alloced = ml_line_alloced();	    /* check if oldp was allocated */
Karsten Hopp 5cef0b
  #ifdef FEAT_NETBEANS_INTG
Karsten Hopp 5cef0b
!     if (was_alloced && usingNetbeans)
Karsten Hopp 5cef0b
! 	netbeans_removed(curbuf, lnum, col, count);
Karsten Hopp 5cef0b
!     /* else is handled by ml_replace() */
Karsten Hopp 5cef0b
  #endif
Karsten Hopp 5cef0b
      if (was_alloced)
Karsten Hopp 5cef0b
  	newp = oldp;			    /* use same allocated memory */
Karsten Hopp 5cef0b
      else
Karsten Hopp 5cef0b
--- 2270,2285 ----
Karsten Hopp 5cef0b
      /*
Karsten Hopp 5cef0b
       * If the old line has been allocated the deletion can be done in the
Karsten Hopp 5cef0b
       * existing line. Otherwise a new line has to be allocated
Karsten Hopp 5cef0b
+      * Can't do this when using Netbeans, because we would need to invoke
Karsten Hopp 5cef0b
+      * netbeans_removed(), which deallocates the line.  Let ml_replace() take
Karsten Hopp 5cef0b
+      * care of notifiying Netbeans.
Karsten Hopp 5cef0b
       */
Karsten Hopp 5cef0b
  #ifdef FEAT_NETBEANS_INTG
Karsten Hopp 5cef0b
!     if (usingNetbeans)
Karsten Hopp 5cef0b
! 	was_alloced = FALSE;
Karsten Hopp 5cef0b
!     else
Karsten Hopp 5cef0b
  #endif
Karsten Hopp 5cef0b
+ 	was_alloced = ml_line_alloced();    /* check if oldp was allocated */
Karsten Hopp 5cef0b
      if (was_alloced)
Karsten Hopp 5cef0b
  	newp = oldp;			    /* use same allocated memory */
Karsten Hopp 5cef0b
      else
Karsten Hopp 5cef0b
***************
Karsten Hopp 5cef0b
*** 3978,3984 ****
Karsten Hopp 5cef0b
  	    /* remove trailing path separator */
Karsten Hopp 5cef0b
  #ifndef MACOS_CLASSIC
Karsten Hopp 5cef0b
  	    /* With MacOS path (with  colons) the final colon is required */
Karsten Hopp 5cef0b
! 	    /* to avoid confusion between absoulute and relative path */
Karsten Hopp 5cef0b
  	    if (pend > p && after_pathsep(p, pend))
Karsten Hopp 5cef0b
  		--pend;
Karsten Hopp 5cef0b
  #endif
Karsten Hopp 5cef0b
--- 3981,3987 ----
Karsten Hopp 5cef0b
  	    /* remove trailing path separator */
Karsten Hopp 5cef0b
  #ifndef MACOS_CLASSIC
Karsten Hopp 5cef0b
  	    /* With MacOS path (with  colons) the final colon is required */
Karsten Hopp 5cef0b
! 	    /* to avoid confusion between absolute and relative path */
Karsten Hopp 5cef0b
  	    if (pend > p && after_pathsep(p, pend))
Karsten Hopp 5cef0b
  		--pend;
Karsten Hopp 5cef0b
  #endif
Karsten Hopp 5cef0b
***************
Karsten Hopp 5cef0b
*** 5689,5695 ****
Karsten Hopp 5cef0b
  	    else if (lookfor_ctor_init || class_or_struct)
Karsten Hopp 5cef0b
  	    {
Karsten Hopp 5cef0b
  		/* we have something found, that looks like the start of
Karsten Hopp 5cef0b
! 		 * cpp-base-class-declaration or contructor-initialization */
Karsten Hopp 5cef0b
  		cpp_base_class = TRUE;
Karsten Hopp 5cef0b
  		lookfor_ctor_init = class_or_struct = FALSE;
Karsten Hopp 5cef0b
  		*col = 0;
Karsten Hopp 5cef0b
--- 5692,5698 ----
Karsten Hopp 5cef0b
  	    else if (lookfor_ctor_init || class_or_struct)
Karsten Hopp 5cef0b
  	    {
Karsten Hopp 5cef0b
  		/* we have something found, that looks like the start of
Karsten Hopp 5cef0b
! 		 * cpp-base-class-declaration or constructor-initialization */
Karsten Hopp 5cef0b
  		cpp_base_class = TRUE;
Karsten Hopp 5cef0b
  		lookfor_ctor_init = class_or_struct = FALSE;
Karsten Hopp 5cef0b
  		*col = 0;
Karsten Hopp 5cef0b
***************
Karsten Hopp 5cef0b
*** 6146,6152 ****
Karsten Hopp 5cef0b
      pos_T	our_paren_pos;
Karsten Hopp 5cef0b
      char_u	*start;
Karsten Hopp 5cef0b
      int		start_brace;
Karsten Hopp 5cef0b
! #define BRACE_IN_COL0		1	    /* '{' is in comumn 0 */
Karsten Hopp 5cef0b
  #define BRACE_AT_START		2	    /* '{' is at start of line */
Karsten Hopp 5cef0b
  #define BRACE_AT_END		3	    /* '{' is at end of line */
Karsten Hopp 5cef0b
      linenr_T	ourscope;
Karsten Hopp 5cef0b
--- 6149,6155 ----
Karsten Hopp 5cef0b
      pos_T	our_paren_pos;
Karsten Hopp 5cef0b
      char_u	*start;
Karsten Hopp 5cef0b
      int		start_brace;
Karsten Hopp 5cef0b
! #define BRACE_IN_COL0		1	    /* '{' is in column 0 */
Karsten Hopp 5cef0b
  #define BRACE_AT_START		2	    /* '{' is at start of line */
Karsten Hopp 5cef0b
  #define BRACE_AT_END		3	    /* '{' is at end of line */
Karsten Hopp 5cef0b
      linenr_T	ourscope;
Karsten Hopp 5cef0b
***************
Karsten Hopp 5cef0b
*** 6369,6375 ****
Karsten Hopp 5cef0b
  		    if (curwin->w_cursor.lnum > 1)
Karsten Hopp 5cef0b
  		    {
Karsten Hopp 5cef0b
  			/* If the start comment string matches in the previous
Karsten Hopp 5cef0b
! 			 * line, use the indent of that line pluss offset.  If
Karsten Hopp 5cef0b
  			 * the middle comment string matches in the previous
Karsten Hopp 5cef0b
  			 * line, use the indent of that line.  XXX */
Karsten Hopp 5cef0b
  			look = skipwhite(ml_get(curwin->w_cursor.lnum - 1));
Karsten Hopp 5cef0b
--- 6372,6378 ----
Karsten Hopp 5cef0b
  		    if (curwin->w_cursor.lnum > 1)
Karsten Hopp 5cef0b
  		    {
Karsten Hopp 5cef0b
  			/* If the start comment string matches in the previous
Karsten Hopp 5cef0b
! 			 * line, use the indent of that line plus offset.  If
Karsten Hopp 5cef0b
  			 * the middle comment string matches in the previous
Karsten Hopp 5cef0b
  			 * line, use the indent of that line.  XXX */
Karsten Hopp 5cef0b
  			look = skipwhite(ml_get(curwin->w_cursor.lnum - 1));
Karsten Hopp 5cef0b
***************
Karsten Hopp 5cef0b
*** 8222,8228 ****
Karsten Hopp 5cef0b
  
Karsten Hopp 5cef0b
  		    if (*that && *that != ';') /* not a comment line */
Karsten Hopp 5cef0b
  		    {
Karsten Hopp 5cef0b
! 			/* test *that != '(' to accomodate first let/do
Karsten Hopp 5cef0b
  			 * argument if it is more than one line */
Karsten Hopp 5cef0b
  			if (!vi_lisp && *that != '(' && *that != '[')
Karsten Hopp 5cef0b
  			    firsttry++;
Karsten Hopp 5cef0b
--- 8225,8231 ----
Karsten Hopp 5cef0b
  
Karsten Hopp 5cef0b
  		    if (*that && *that != ';') /* not a comment line */
Karsten Hopp 5cef0b
  		    {
Karsten Hopp 5cef0b
! 			/* test *that != '(' to accommodate first let/do
Karsten Hopp 5cef0b
  			 * argument if it is more than one line */
Karsten Hopp 5cef0b
  			if (!vi_lisp && *that != '(' && *that != '[')
Karsten Hopp 5cef0b
  			    firsttry++;
Karsten Hopp 5cef0b
*** ../vim-7.1.246/src/version.c	Wed Feb 13 10:27:28 2008
Karsten Hopp 5cef0b
--- src/version.c	Wed Feb 13 10:56:42 2008
Karsten Hopp 5cef0b
***************
Karsten Hopp 5cef0b
*** 668,669 ****
Karsten Hopp 5cef0b
--- 668,671 ----
Karsten Hopp 5cef0b
  {   /* Add new patch number below this line */
Karsten Hopp 5cef0b
+ /**/
Karsten Hopp 5cef0b
+     247,
Karsten Hopp 5cef0b
  /**/
Karsten Hopp 5cef0b
Karsten Hopp 5cef0b
-- 
Karsten Hopp 5cef0b
Far back in the mists of ancient time, in the great and glorious days of the
Karsten Hopp 5cef0b
former Galactic Empire, life was wild, rich and largely tax free.
Karsten Hopp 5cef0b
Mighty starships plied their way between exotic suns, seeking adventure and
Karsten Hopp 5cef0b
reward among the furthest reaches of Galactic space.  In those days, spirits
Karsten Hopp 5cef0b
were brave, the stakes were high, men were real men, women were real women
Karsten Hopp 5cef0b
and small furry creatures from Alpha Centauri were real small furry creatures
Karsten Hopp 5cef0b
from Alpha Centauri.  And all dared to brave unknown terrors, to do mighty
Karsten Hopp 5cef0b
deeds, to boldly split infinitives that no man had split before -- and thus
Karsten Hopp 5cef0b
was the Empire forged.
Karsten Hopp 5cef0b
		-- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"
Karsten Hopp 5cef0b
Karsten Hopp 5cef0b
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 5cef0b
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 5cef0b
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 5cef0b
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///