1
0
mirror of https://github.com/janet-lang/janet synced 2024-06-26 07:03:16 +00:00
Pressing tab only does one thing at a time.
This commit is contained in:
Calvin Rose 2020-01-18 09:44:59 -06:00
parent 9d8af7355f
commit 772916593b

View File

@ -440,7 +440,6 @@ static void check_specials(JanetByteView src) {
check_cmatch(src, "while");
}
/* TODO - check against special forms and print in alphabetical order */
static void kshowcomp(void) {
JanetTable *env = gbl_complete_env;
if (env == NULL) {
@ -449,6 +448,10 @@ static void kshowcomp(void) {
return;
}
/* Advance while on symbol char */
while (is_symbol_char_gen(gbl_buf[gbl_pos]))
gbl_pos++;
JanetByteView prefix = get_symprefix();
if (prefix.len == 0) return;
@ -471,6 +474,8 @@ static void kshowcomp(void) {
insert(lcp.bytes[i], 0);
}
if (prefix.len != lcp.len) return;
int32_t maxlen = 0;
for (int i = 0; i < gbl_match_count; i++)
if (gbl_matches[i].len > maxlen)