diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-09-27 14:39:09 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-09-27 14:39:09 -0700 |
commit | b2d56ff8790154fefefcc40e7b3c84ab97559938 (patch) | |
tree | 5eaeefc8f3a286a05e3e551932bf8a2182e5b9d3 /parser.c | |
parent | cec96d814a65ffe7fa3f8a80c32068cb1532c4e9 (diff) | |
download | txr-b2d56ff8790154fefefcc40e7b3c84ab97559938.tar.gz txr-b2d56ff8790154fefefcc40e7b3c84ab97559938.tar.bz2 txr-b2d56ff8790154fefefcc40e7b3c84ab97559938.zip |
Treat .( and (( context in completion.
* parser.c (provide_completions): Don't pass the context
parenthesis to find_matching_syms in additional cases: when
preceded by a dot, or another parenthesis. This causes
completion situations such as (let ((var[TAB] and
obj.(method[TAB] not to be wrongly restricted to the function
space.
Diffstat (limited to 'parser.c')
-rw-r--r-- | parser.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -533,8 +533,10 @@ static void provide_completions(const char *data, char prev = (end > data) ? end[-1] : 0; char pprev = (end > data + 1) ? end[-2] : 0; int quote = (pprev == '^' || pprev == '\'' || pprev == '#'); + int meth = (pprev == '.'); + int ppar = (pprev == '('); int dwim = (prev == '['); - char par = (!pprev || !quote || dwim) ? prev : 0; + char par = (!pprev || (!quote && !meth && !ppar) || dwim) ? prev : 0; find_matching_syms(cpl, or2(package, user_package), sym_pfx, line_pfx, par, if2(package, null(keyword))); |