summaryrefslogtreecommitdiffstats
path: root/linenoise/linenoise.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-10-03 22:33:13 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-10-03 22:33:13 -0700
commit7996c1fa2d68251430a5007e97ef4e8f39429a26 (patch)
tree67aaf8afbf4d7f2acfa7924df39e0942b1843fa0 /linenoise/linenoise.h
parentb7f008ea4356ab41264a84e65e595d41c3e01ccb (diff)
downloadtxr-7996c1fa2d68251430a5007e97ef4e8f39429a26.tar.gz
txr-7996c1fa2d68251430a5007e97ef4e8f39429a26.tar.bz2
txr-7996c1fa2d68251430a5007e97ef4e8f39429a26.zip
linenoise: substring flag in completion callback.
A feature is hereby introduced into linenoise whereby completion mode can be entered via Ctrl-X Tab also, not only Tab. This is distinguished with a flag in the completion structure. The intent is that the callback can use this to provide substring matches not only prefix matches. * linenoise/linenoise.c (complete_line): Takes a new argument, and stores it in the new substring member of lino_completions_t. (edit): If Tab is typed while in Ctrl-X extended mode, then fall through to the regular switch, where the TAB case now recognizes that it is in extended mode and passes the mode flag to complete_line. * linenoise/linenoise.h (lino_completions_t): New member, substring.
Diffstat (limited to 'linenoise/linenoise.h')
-rw-r--r--linenoise/linenoise.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/linenoise/linenoise.h b/linenoise/linenoise.h
index 94cf3913..b6919254 100644
--- a/linenoise/linenoise.h
+++ b/linenoise/linenoise.h
@@ -50,6 +50,7 @@ typedef struct lino_state lino_t;
typedef struct lino_completions {
size_t len;
char **cvec;
+ int substring;
} lino_completions_t;
typedef void lino_compl_cb_t(const char *, lino_completions_t *, void *ctx);