summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <bram@vim.org>2010-10-13 16:44:23 +0200
committerBram Moolenaar <bram@vim.org>2010-10-13 16:44:23 +0200
commit1f319d3166b5bbe85a3b7677fe29a252bfd4097c (patch)
treeb6c90731e69079dbcc4094ff427d1464a4ae535b
parent5946174c4d09bd270bf9d043c7b451ac43097807 (diff)
downloadvim-1f319d3166b5bbe85a3b7677fe29a252bfd4097c.tar.gz
updated for version 7.3.024v7.3.024v7-3-024
Problem: Named signs do not use a negative number as intended. Solution: Fix the numbering of named signs. (Xavier de Gaye)
-rw-r--r--src/ex_cmds.c19
-rw-r--r--src/version.c2
2 files changed, 13 insertions, 8 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index d53652fd..e8b39b3c 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -6670,11 +6670,6 @@ ex_sign(eap)
sp = (sign_T *)alloc_clear((unsigned)sizeof(sign_T));
if (sp == NULL)
return;
- if (sp_prev == NULL)
- first_sign = sp;
- else
- sp_prev->sn_next = sp;
- sp->sn_name = vim_strnsave(arg, (int)(p - arg));
/* If the name is a number use that for the typenr,
* otherwise use a negative number. */
@@ -6687,13 +6682,14 @@ ex_sign(eap)
for (lp = first_sign; lp != NULL; lp = lp->sn_next)
{
- if (lp->sn_typenr == last_sign_typenr)
+ if (lp->sn_typenr == -last_sign_typenr)
{
--last_sign_typenr;
if (last_sign_typenr == 0)
last_sign_typenr = MAX_TYPENR;
if (last_sign_typenr == start)
{
+ vim_free(sp);
EMSG(_("E612: Too many signs defined"));
return;
}
@@ -6702,10 +6698,17 @@ ex_sign(eap)
}
}
- sp->sn_typenr = last_sign_typenr--;
- if (last_sign_typenr == 0)
+ sp->sn_typenr = -last_sign_typenr;
+ if (--last_sign_typenr == 0)
last_sign_typenr = MAX_TYPENR; /* wrap around */
}
+
+ /* add the new sign to the list of signs */
+ if (sp_prev == NULL)
+ first_sign = sp;
+ else
+ sp_prev->sn_next = sp;
+ sp->sn_name = vim_strnsave(arg, (int)(p - arg));
}
/* set values for a defined sign. */
diff --git a/src/version.c b/src/version.c
index 6b7742e9..882f9a14 100644
--- a/src/version.c
+++ b/src/version.c
@@ -715,6 +715,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 24,
+/**/
23,
/**/
22,