Karsten Hopp 15f66e
To: vim-dev@vim.org
Karsten Hopp 15f66e
Subject: Patch 7.3.024
Karsten Hopp 15f66e
Fcc: outbox
Karsten Hopp 15f66e
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 15f66e
Mime-Version: 1.0
Karsten Hopp 15f66e
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 15f66e
Content-Transfer-Encoding: 8bit
Karsten Hopp 15f66e
------------
Karsten Hopp 15f66e
Karsten Hopp 15f66e
Patch 7.3.024
Karsten Hopp 15f66e
Problem:    Named signs do not use a negative number as intended.
Karsten Hopp 15f66e
Solution:   Fix the numbering of named signs. (Xavier de Gaye)
Karsten Hopp 15f66e
Files:	    src/ex_cmds.c
Karsten Hopp 15f66e
Karsten Hopp 15f66e
Karsten Hopp 15f66e
*** ../vim-7.3.023/src/ex_cmds.c	2010-09-21 16:56:29.000000000 +0200
Karsten Hopp 15f66e
--- src/ex_cmds.c	2010-10-13 16:37:18.000000000 +0200
Karsten Hopp 15f66e
***************
Karsten Hopp 15f66e
*** 6670,6680 ****
Karsten Hopp 15f66e
  		    sp = (sign_T *)alloc_clear((unsigned)sizeof(sign_T));
Karsten Hopp 15f66e
  		    if (sp == NULL)
Karsten Hopp 15f66e
  			return;
Karsten Hopp 15f66e
- 		    if (sp_prev == NULL)
Karsten Hopp 15f66e
- 			first_sign = sp;
Karsten Hopp 15f66e
- 		    else
Karsten Hopp 15f66e
- 			sp_prev->sn_next = sp;
Karsten Hopp 15f66e
- 		    sp->sn_name = vim_strnsave(arg, (int)(p - arg));
Karsten Hopp 15f66e
  
Karsten Hopp 15f66e
  		    /* If the name is a number use that for the typenr,
Karsten Hopp 15f66e
  		     * otherwise use a negative number. */
Karsten Hopp 15f66e
--- 6670,6675 ----
Karsten Hopp 15f66e
***************
Karsten Hopp 15f66e
*** 6687,6699 ****
Karsten Hopp 15f66e
  
Karsten Hopp 15f66e
  			for (lp = first_sign; lp != NULL; lp = lp->sn_next)
Karsten Hopp 15f66e
  			{
Karsten Hopp 15f66e
! 			    if (lp->sn_typenr == last_sign_typenr)
Karsten Hopp 15f66e
  			    {
Karsten Hopp 15f66e
  				--last_sign_typenr;
Karsten Hopp 15f66e
  				if (last_sign_typenr == 0)
Karsten Hopp 15f66e
  				    last_sign_typenr = MAX_TYPENR;
Karsten Hopp 15f66e
  				if (last_sign_typenr == start)
Karsten Hopp 15f66e
  				{
Karsten Hopp 15f66e
  				    EMSG(_("E612: Too many signs defined"));
Karsten Hopp 15f66e
  				    return;
Karsten Hopp 15f66e
  				}
Karsten Hopp 15f66e
--- 6682,6695 ----
Karsten Hopp 15f66e
  
Karsten Hopp 15f66e
  			for (lp = first_sign; lp != NULL; lp = lp->sn_next)
Karsten Hopp 15f66e
  			{
Karsten Hopp 15f66e
! 			    if (lp->sn_typenr == -last_sign_typenr)
Karsten Hopp 15f66e
  			    {
Karsten Hopp 15f66e
  				--last_sign_typenr;
Karsten Hopp 15f66e
  				if (last_sign_typenr == 0)
Karsten Hopp 15f66e
  				    last_sign_typenr = MAX_TYPENR;
Karsten Hopp 15f66e
  				if (last_sign_typenr == start)
Karsten Hopp 15f66e
  				{
Karsten Hopp 15f66e
+ 				    vim_free(sp);
Karsten Hopp 15f66e
  				    EMSG(_("E612: Too many signs defined"));
Karsten Hopp 15f66e
  				    return;
Karsten Hopp 15f66e
  				}
Karsten Hopp 15f66e
***************
Karsten Hopp 15f66e
*** 6702,6711 ****
Karsten Hopp 15f66e
  			    }
Karsten Hopp 15f66e
  			}
Karsten Hopp 15f66e
  
Karsten Hopp 15f66e
! 			sp->sn_typenr = last_sign_typenr--;
Karsten Hopp 15f66e
! 			if (last_sign_typenr == 0)
Karsten Hopp 15f66e
  			    last_sign_typenr = MAX_TYPENR; /* wrap around */
Karsten Hopp 15f66e
  		    }
Karsten Hopp 15f66e
  		}
Karsten Hopp 15f66e
  
Karsten Hopp 15f66e
  		/* set values for a defined sign. */
Karsten Hopp 15f66e
--- 6698,6714 ----
Karsten Hopp 15f66e
  			    }
Karsten Hopp 15f66e
  			}
Karsten Hopp 15f66e
  
Karsten Hopp 15f66e
! 			sp->sn_typenr = -last_sign_typenr;
Karsten Hopp 15f66e
! 			if (--last_sign_typenr == 0)
Karsten Hopp 15f66e
  			    last_sign_typenr = MAX_TYPENR; /* wrap around */
Karsten Hopp 15f66e
  		    }
Karsten Hopp 15f66e
+ 
Karsten Hopp 15f66e
+ 		    /* add the new sign to the list of signs */
Karsten Hopp 15f66e
+ 		    if (sp_prev == NULL)
Karsten Hopp 15f66e
+ 			first_sign = sp;
Karsten Hopp 15f66e
+ 		    else
Karsten Hopp 15f66e
+ 			sp_prev->sn_next = sp;
Karsten Hopp 15f66e
+ 		    sp->sn_name = vim_strnsave(arg, (int)(p - arg));
Karsten Hopp 15f66e
  		}
Karsten Hopp 15f66e
  
Karsten Hopp 15f66e
  		/* set values for a defined sign. */
Karsten Hopp 15f66e
*** ../vim-7.3.023/src/version.c	2010-10-13 16:22:05.000000000 +0200
Karsten Hopp 15f66e
--- src/version.c	2010-10-13 16:42:14.000000000 +0200
Karsten Hopp 15f66e
***************
Karsten Hopp 15f66e
*** 716,717 ****
Karsten Hopp 15f66e
--- 716,719 ----
Karsten Hopp 15f66e
  {   /* Add new patch number below this line */
Karsten Hopp 15f66e
+ /**/
Karsten Hopp 15f66e
+     24,
Karsten Hopp 15f66e
  /**/
Karsten Hopp 15f66e
Karsten Hopp 15f66e
-- 
Karsten Hopp 15f66e
       In war we're tough and able.
Karsten Hopp 15f66e
       Quite indefatigable
Karsten Hopp 15f66e
       Between our quests
Karsten Hopp 15f66e
       We sequin vests
Karsten Hopp 15f66e
       And impersonate Clark Gable
Karsten Hopp 15f66e
       It's a busy life in Camelot.
Karsten Hopp 15f66e
       I have to push the pram a lot.
Karsten Hopp 15f66e
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
Karsten Hopp 15f66e
Karsten Hopp 15f66e
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 15f66e
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 15f66e
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 15f66e
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///