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