comparison src/nv_cmdidxs.h @ 27447:4050f0554902 v8.2.4252

patch 8.2.4252: generating the normal command table at runtime is inefficient Commit: https://github.com/vim/vim/commit/4dc0dd869972ddafc7d9ee5ea765645b818a6dc9 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Sat Jan 29 13:06:40 2022 +0000 patch 8.2.4252: generating the normal command table at runtime is inefficient Problem: Generating the normal command table at runtime is inefficient. Solution: Generate the table with a Vim script and put it in a header file. (Yegappan Lakshmanan, closes #9648)
author Bram Moolenaar <Bram@vim.org>
date Sat, 29 Jan 2022 14:15:04 +0100
parents
children
comparison
equal deleted inserted replaced
27446:d5dcb8d0cf5e 27447:4050f0554902
1 /*
2 * Automatically generated code by the create_nvcmdidxs.vim script.
3 *
4 * Table giving the index in nv_cmds[] to lookup based on
5 * the command character.
6 */
7
8 // nv_cmd_idx[<normal mode command character>] => nv_cmds[] index
9 static const unsigned short nv_cmd_idx[] =
10 {
11 /* 0 */ 0,
12 /* 1 */ 1,
13 /* 2 */ 2,
14 /* 3 */ 3,
15 /* 4 */ 4,
16 /* 5 */ 5,
17 /* 6 */ 6,
18 /* 7 */ 7,
19 /* 8 */ 8,
20 /* 9 */ 9,
21 /* 10 */ 10,
22 /* 11 */ 11,
23 /* 12 */ 12,
24 /* 13 */ 13,
25 /* 14 */ 14,
26 /* 15 */ 15,
27 /* 16 */ 16,
28 /* 17 */ 17,
29 /* 18 */ 18,
30 /* 19 */ 19,
31 /* 20 */ 20,
32 /* 21 */ 21,
33 /* 22 */ 22,
34 /* 23 */ 23,
35 /* 24 */ 24,
36 /* 25 */ 25,
37 /* 26 */ 26,
38 /* 27 */ 27,
39 /* 28 */ 28,
40 /* 29 */ 29,
41 /* 30 */ 30,
42 /* 31 */ 31,
43 /* 32 */ 32,
44 /* 33 */ 33,
45 /* 34 */ 34,
46 /* 35 */ 35,
47 /* 36 */ 36,
48 /* 37 */ 37,
49 /* 38 */ 38,
50 /* 39 */ 39,
51 /* 40 */ 40,
52 /* 41 */ 41,
53 /* 42 */ 42,
54 /* 43 */ 43,
55 /* 44 */ 44,
56 /* 45 */ 45,
57 /* 46 */ 46,
58 /* 47 */ 47,
59 /* 48 */ 48,
60 /* 49 */ 49,
61 /* 50 */ 50,
62 /* 51 */ 51,
63 /* 52 */ 52,
64 /* 53 */ 53,
65 /* 54 */ 54,
66 /* 55 */ 55,
67 /* 56 */ 56,
68 /* 57 */ 57,
69 /* 58 */ 58,
70 /* 59 */ 59,
71 /* 60 */ 60,
72 /* 61 */ 61,
73 /* 62 */ 62,
74 /* 63 */ 63,
75 /* 64 */ 64,
76 /* 65 */ 65,
77 /* 66 */ 66,
78 /* 67 */ 67,
79 /* 68 */ 68,
80 /* 69 */ 69,
81 /* 70 */ 70,
82 /* 71 */ 71,
83 /* 72 */ 72,
84 /* 73 */ 73,
85 /* 74 */ 74,
86 /* 75 */ 75,
87 /* 76 */ 76,
88 /* 77 */ 77,
89 /* 78 */ 78,
90 /* 79 */ 79,
91 /* 80 */ 80,
92 /* 81 */ 81,
93 /* 82 */ 82,
94 /* 83 */ 83,
95 /* 84 */ 84,
96 /* 85 */ 85,
97 /* 86 */ 86,
98 /* 87 */ 87,
99 /* 88 */ 88,
100 /* 89 */ 89,
101 /* 90 */ 90,
102 /* 91 */ 91,
103 /* 92 */ 92,
104 /* 93 */ 93,
105 /* 94 */ 94,
106 /* 95 */ 95,
107 /* 96 */ 96,
108 /* 97 */ 97,
109 /* 98 */ 98,
110 /* 99 */ 99,
111 /* 100 */ 100,
112 /* 101 */ 101,
113 /* 102 */ 102,
114 /* 103 */ 103,
115 /* 104 */ 104,
116 /* 105 */ 105,
117 /* 106 */ 106,
118 /* 107 */ 107,
119 /* 108 */ 108,
120 /* 109 */ 109,
121 /* 110 */ 110,
122 /* 111 */ 111,
123 /* 112 */ 112,
124 /* 113 */ 113,
125 /* 114 */ 114,
126 /* 115 */ 115,
127 /* 116 */ 116,
128 /* 117 */ 117,
129 /* 118 */ 118,
130 /* 119 */ 119,
131 /* 120 */ 120,
132 /* 121 */ 121,
133 /* 122 */ 122,
134 /* 123 */ 123,
135 /* 124 */ 124,
136 /* 125 */ 125,
137 /* 126 */ 126,
138 /* 163 */ 127,
139 /* 1277 */ 156,
140 /* 1533 */ 158,
141 /* 11517 */ 132,
142 /* 11773 */ 134,
143 /* 12029 */ 135,
144 /* 12285 */ 138,
145 /* 12541 */ 139,
146 /* 12581 */ 180,
147 /* 12619 */ 174,
148 /* 12651 */ 181,
149 /* 12797 */ 140,
150 /* 12835 */ 175,
151 /* 13053 */ 141,
152 /* 13131 */ 166,
153 /* 13309 */ 142,
154 /* 13347 */ 160,
155 /* 13387 */ 170,
156 /* 13565 */ 143,
157 /* 13643 */ 168,
158 /* 13821 */ 150,
159 /* 14122 */ 171,
160 /* 14144 */ 169,
161 /* 14374 */ 179,
162 /* 14845 */ 182,
163 /* 16966 */ 188,
164 /* 17515 */ 177,
165 /* 17917 */ 133,
166 /* 18173 */ 136,
167 /* 18795 */ 152,
168 /* 19453 */ 129,
169 /* 19709 */ 128,
170 /* 19965 */ 130,
171 /* 20075 */ 167,
172 /* 20221 */ 131,
173 /* 20477 */ 153,
174 /* 20587 */ 165,
175 /* 20733 */ 178,
176 /* 21328 */ 191,
177 /* 22013 */ 161,
178 /* 22269 */ 164,
179 /* 22525 */ 176,
180 /* 22767 */ 187,
181 /* 22768 */ 186,
182 /* 22773 */ 183,
183 /* 22776 */ 185,
184 /* 22777 */ 184,
185 /* 22781 */ 172,
186 /* 23037 */ 144,
187 /* 23293 */ 145,
188 /* 23549 */ 146,
189 /* 23805 */ 147,
190 /* 24061 */ 148,
191 /* 24317 */ 149,
192 /* 24573 */ 189,
193 /* 24829 */ 190,
194 /* 25085 */ 151,
195 /* 25195 */ 154,
196 /* 25707 */ 157,
197 /* 25853 */ 137,
198 /* 26621 */ 192,
199 /* 26731 */ 173,
200 /* 26877 */ 193,
201 /* 26917 */ 163,
202 /* 27755 */ 159,
203 /* 29291 */ 162,
204 /* 30059 */ 155,
205 };
206
207 // The highest index for which
208 // nv_cmds[idx].cmd_char == nv_cmd_idx[nv_cmds[idx].cmd_char]
209 static const int nv_max_linear = 126;