diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-10-03 22:37:21 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-10-03 22:37:21 -0700 |
commit | 66320508c3c964ea33584c5c4b1b84850ae469bf (patch) | |
tree | 609da94c8b1c5a34c3eea52c1953ec00960a665b /parser.c | |
parent | 7996c1fa2d68251430a5007e97ef4e8f39429a26 (diff) | |
download | txr-66320508c3c964ea33584c5c4b1b84850ae469bf.tar.gz txr-66320508c3c964ea33584c5c4b1b84850ae469bf.tar.bz2 txr-66320508c3c964ea33584c5c4b1b84850ae469bf.zip |
Interactive listener: substring completion.
* parser.c (find_matching_syms): Take advantage of the
linenoise Ctrl-X Tab feature by providing substring matches.
* txr.1: Documented Ctrl-X Tab.
Diffstat (limited to 'parser.c')
-rw-r--r-- | parser.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -424,8 +424,11 @@ static void find_matching_syms(lino_completions_t *cpl, for (syms = package_symbols(package); syms; syms = cdr(syms)) { val sym = car(syms); val name = symbol_name(sym); + val found = if3(cpl->substring, + search_str(name, prefix, zero, nil), + match_str(name, prefix, zero)); - if (match_str(name, prefix, zero)) { + if (found) { val comple; switch (par) { |