From f322b46efb5292ed73fd256e712b940b50da3cdf Mon Sep 17 00:00:00 2001 From: hlolli Date: Tue, 19 Dec 2017 13:40:46 +0100 Subject: [PATCH] on empty line-suffix, don't get completions --- src/cljs/snapshot/lumo/repl.cljs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/cljs/snapshot/lumo/repl.cljs b/src/cljs/snapshot/lumo/repl.cljs index 6b7e30e8..c36f53e2 100644 --- a/src/cljs/snapshot/lumo/repl.cljs +++ b/src/cljs/snapshot/lumo/repl.cljs @@ -1445,12 +1445,14 @@ ns-alias (second (re-find #"\(*(\b[a-zA-Z-.<>*=&?]+)/[a-zA-Z-]*$" line)) line-match-suffix (first (re-find #":?([a-zA-Z-.<>*=&?]*|^\(/)$" line)) line-prefix (subs line 0 (- (count line) (count line-match-suffix))) - completions (reduce (fn [ret item] - (doto ret - (.push (str line-prefix item)))) + completions (if (empty? line-match-suffix) #js [] - (filter #(is-completion? line-match-suffix %) - (completion-candidates top-level? ns-alias)))] + (reduce (fn [ret item] + (doto ret + (.push (str line-prefix item)))) + #js [] + (filter #(is-completion? line-match-suffix %) + (completion-candidates top-level? ns-alias))))] (cb (doto completions .sort)))))