]>
Commit | Line | Data |
---|---|---|
17e7d110 SS |
1 | To: vim-dev@vim.org |
2 | Subject: Patch 7.3.024 | |
3 | Fcc: outbox | |
4 | From: Bram Moolenaar <Bram@moolenaar.net> | |
5 | Mime-Version: 1.0 | |
6 | Content-Type: text/plain; charset=UTF-8 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ------------ | |
9 | ||
10 | Patch 7.3.024 | |
11 | Problem: Named signs do not use a negative number as intended. | |
12 | Solution: Fix the numbering of named signs. (Xavier de Gaye) | |
13 | Files: src/ex_cmds.c | |
14 | ||
15 | ||
16 | *** ../vim-7.3.023/src/ex_cmds.c 2010-09-21 16:56:29.000000000 +0200 | |
17 | --- src/ex_cmds.c 2010-10-13 16:37:18.000000000 +0200 | |
18 | *************** | |
19 | *** 6670,6680 **** | |
20 | sp = (sign_T *)alloc_clear((unsigned)sizeof(sign_T)); | |
21 | if (sp == NULL) | |
22 | return; | |
23 | - if (sp_prev == NULL) | |
24 | - first_sign = sp; | |
25 | - else | |
26 | - sp_prev->sn_next = sp; | |
27 | - sp->sn_name = vim_strnsave(arg, (int)(p - arg)); | |
28 | ||
29 | /* If the name is a number use that for the typenr, | |
30 | * otherwise use a negative number. */ | |
31 | --- 6670,6675 ---- | |
32 | *************** | |
33 | *** 6687,6699 **** | |
34 | ||
35 | for (lp = first_sign; lp != NULL; lp = lp->sn_next) | |
36 | { | |
37 | ! if (lp->sn_typenr == last_sign_typenr) | |
38 | { | |
39 | --last_sign_typenr; | |
40 | if (last_sign_typenr == 0) | |
41 | last_sign_typenr = MAX_TYPENR; | |
42 | if (last_sign_typenr == start) | |
43 | { | |
44 | EMSG(_("E612: Too many signs defined")); | |
45 | return; | |
46 | } | |
47 | --- 6682,6695 ---- | |
48 | ||
49 | for (lp = first_sign; lp != NULL; lp = lp->sn_next) | |
50 | { | |
51 | ! if (lp->sn_typenr == -last_sign_typenr) | |
52 | { | |
53 | --last_sign_typenr; | |
54 | if (last_sign_typenr == 0) | |
55 | last_sign_typenr = MAX_TYPENR; | |
56 | if (last_sign_typenr == start) | |
57 | { | |
58 | + vim_free(sp); | |
59 | EMSG(_("E612: Too many signs defined")); | |
60 | return; | |
61 | } | |
62 | *************** | |
63 | *** 6702,6711 **** | |
64 | } | |
65 | } | |
66 | ||
67 | ! sp->sn_typenr = last_sign_typenr--; | |
68 | ! if (last_sign_typenr == 0) | |
69 | last_sign_typenr = MAX_TYPENR; /* wrap around */ | |
70 | } | |
71 | } | |
72 | ||
73 | /* set values for a defined sign. */ | |
74 | --- 6698,6714 ---- | |
75 | } | |
76 | } | |
77 | ||
78 | ! sp->sn_typenr = -last_sign_typenr; | |
79 | ! if (--last_sign_typenr == 0) | |
80 | last_sign_typenr = MAX_TYPENR; /* wrap around */ | |
81 | } | |
82 | + | |
83 | + /* add the new sign to the list of signs */ | |
84 | + if (sp_prev == NULL) | |
85 | + first_sign = sp; | |
86 | + else | |
87 | + sp_prev->sn_next = sp; | |
88 | + sp->sn_name = vim_strnsave(arg, (int)(p - arg)); | |
89 | } | |
90 | ||
91 | /* set values for a defined sign. */ | |
92 | *** ../vim-7.3.023/src/version.c 2010-10-13 16:22:05.000000000 +0200 | |
93 | --- src/version.c 2010-10-13 16:42:14.000000000 +0200 | |
94 | *************** | |
95 | *** 716,717 **** | |
96 | --- 716,719 ---- | |
97 | { /* Add new patch number below this line */ | |
98 | + /**/ | |
99 | + 24, | |
100 | /**/ | |
101 | ||
102 | -- | |
103 | In war we're tough and able. | |
104 | Quite indefatigable | |
105 | Between our quests | |
106 | We sequin vests | |
107 | And impersonate Clark Gable | |
108 | It's a busy life in Camelot. | |
109 | I have to push the pram a lot. | |
110 | "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD | |
111 | ||
112 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
113 | /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
114 | \\\ download, build and distribute -- http://www.A-A-P.org /// | |
115 | \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |