4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
10 Patch 7.3.028 (after 7.3.024)
11 Problem: Signs don't show up. (Charles Campbell)
12 Solution: Don't use negative numbers. Also assign a number to signs that
13 have a name of all digits to avoid using a sign number twice.
17 *** ../vim-7.3.027/src/ex_cmds.c 2010-10-13 16:44:17.000000000 +0200
18 --- src/ex_cmds.c 2010-10-14 20:59:04.000000000 +0200
23 static sign_T *first_sign = NULL;
24 ! static int last_sign_typenr = MAX_TYPENR; /* is decremented */
26 static int sign_cmd_idx __ARGS((char_u *begin_cmd, char_u *end_cmd));
27 static void sign_list_defined __ARGS((sign_T *sp));
31 static sign_T *first_sign = NULL;
32 ! static int next_sign_typenr = 1;
34 static int sign_cmd_idx __ARGS((char_u *begin_cmd, char_u *end_cmd));
35 static void sign_list_defined __ARGS((sign_T *sp));
39 EMSG(_("E156: Missing sign name"));
42 + /* Isolate the sign name. If it's a number skip leading zeroes,
43 + * so that "099" and "99" are the same sign. But keep "0". */
47 + while (arg[0] == '0' && arg[1] != NUL)
51 for (sp = first_sign; sp != NULL; sp = sp->sn_next)
55 /* ":sign define {name} ...": define a sign */
58 /* Allocate a new sign. */
59 sp = (sign_T *)alloc_clear((unsigned)sizeof(sign_T));
63 ! /* If the name is a number use that for the typenr,
64 ! * otherwise use a negative number. */
65 ! if (VIM_ISDIGIT(*arg))
66 ! sp->sn_typenr = atoi((char *)arg);
70 ! int start = last_sign_typenr;
72 ! for (lp = first_sign; lp != NULL; lp = lp->sn_next)
74 ! if (lp->sn_typenr == -last_sign_typenr)
77 ! if (last_sign_typenr == 0)
78 ! last_sign_typenr = MAX_TYPENR;
79 ! if (last_sign_typenr == start)
82 ! EMSG(_("E612: Too many signs defined"));
90 ! sp->sn_typenr = -last_sign_typenr;
91 ! if (--last_sign_typenr == 0)
92 ! last_sign_typenr = MAX_TYPENR; /* wrap around */
95 /* add the new sign to the list of signs */
97 /* ":sign define {name} ...": define a sign */
101 + int start = next_sign_typenr;
103 /* Allocate a new sign. */
104 sp = (sign_T *)alloc_clear((unsigned)sizeof(sign_T));
108 ! /* Check that next_sign_typenr is not already being used.
109 ! * This only happens after wrapping around. Hopefully
110 ! * another one got deleted and we can use its number. */
111 ! for (lp = first_sign; lp != NULL; )
113 ! if (lp->sn_typenr == next_sign_typenr)
115 ! ++next_sign_typenr;
116 ! if (next_sign_typenr == MAX_TYPENR)
117 ! next_sign_typenr = 1;
118 ! if (next_sign_typenr == start)
121 ! EMSG(_("E612: Too many signs defined"));
124 + lp = first_sign; /* start all over */
130 + sp->sn_typenr = next_sign_typenr;
131 + if (++next_sign_typenr == MAX_TYPENR)
132 + next_sign_typenr = 1; /* wrap around */
134 ! sp->sn_name = vim_strsave(arg);
135 ! if (sp->sn_name == NULL) /* out of memory */
141 /* add the new sign to the list of signs */
146 sp_prev->sn_next = sp;
147 - sp->sn_name = vim_strnsave(arg, (int)(p - arg));
150 /* set values for a defined sign. */
155 arg = skiptowhite(arg);
158 + while (sign_name[0] == '0' && sign_name[1] != NUL)
161 else if (STRNCMP(arg, "file=", 5) == 0)
163 *** ../vim-7.3.027/src/version.c 2010-10-13 20:37:37.000000000 +0200
164 --- src/version.c 2010-10-14 20:50:54.000000000 +0200
168 { /* Add new patch number below this line */
174 This is an airconditioned room, do not open Windows.
176 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
177 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
178 \\\ download, build and distribute -- http://www.A-A-P.org ///
179 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///