Overview
Comment: | Fix tab completion |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
2200947ce957ddb35e68f3d631cc4b71 |
User & Date: | js on 2025-03-12 23:28:37 |
Other Links: | manifest | tags |
Context
2025-03-15
| ||
00:24 | More string migrations check-in: 5659be76db user: js tags: trunk | |
2025-03-12
| ||
23:28 | Fix tab completion check-in: 2200947ce9 user: js tags: trunk | |
23:06 | Default to -O2 check-in: 50af4ea0ff user: js tags: trunk | |
Changes
Modified src/commands.mm from [e9b116439f] to [d5247fc383].
︙ | ︙ | |||
294 295 296 297 298 299 300 | void resetcomplete() { completesize = 0; } void | | < < | < | < < < | | < | | | | > | | < | 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 | void resetcomplete() { completesize = 0; } void complete(OFMutableString *s) { @autoreleasepool { if (![s hasPrefix:@"/"]) [s insertString:@"/" atIndex:0]; if (s.length == 1) return; if (!completesize) { completesize = s.length - 1; completeidx = 0; } __block int idx = 0; [identifiers enumerateKeysAndObjectsUsingBlock:^( OFString *name, Identifier *identifier, bool *stop) { if (strncmp(identifier.name.UTF8String, s.UTF8String + 1, completesize) == 0 && idx++ == completeidx) [s replaceCharactersInRange:OFMakeRange( 1, s.length - 1) withString:identifier.name]; }]; completeidx++; if (completeidx >= idx) completeidx = 0; } |
︙ | ︙ |
Modified src/protos.h from [442aaeb8db] to [2b4f29b604].
1 2 3 4 5 6 7 8 9 10 11 12 13 | // protos for ALL external functions in cube... // command extern int variable(OFString *name, int min, int cur, int max, int *storage, void (*fun)(), bool persist); extern void setvar(OFString *name, int i); extern int getvar(OFString *name); extern bool identexists(OFString *name); extern bool addcommand(OFString *name, void (*fun)(), int narg); extern int execute(OFString *p, bool down = true); extern void exec(OFString *cfgfile); extern bool execfile(OFIRI *cfgfile); extern void resetcomplete(); | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | // protos for ALL external functions in cube... // command extern int variable(OFString *name, int min, int cur, int max, int *storage, void (*fun)(), bool persist); extern void setvar(OFString *name, int i); extern int getvar(OFString *name); extern bool identexists(OFString *name); extern bool addcommand(OFString *name, void (*fun)(), int narg); extern int execute(OFString *p, bool down = true); extern void exec(OFString *cfgfile); extern bool execfile(OFIRI *cfgfile); extern void resetcomplete(); extern void complete(OFMutableString *s); extern void alias(OFString *name, OFString *action); extern OFString *getalias(OFString *name); extern void writecfg(); // console extern void keypress(int code, bool isDown); extern void input(OFString *text); |
︙ | ︙ |