Enabled auto-completion after typing the first word.
h3rald h3rald@h3rald.com
Mon, 08 Dec 2014 20:35:41 +0100
1 files changed,
7 insertions(+),
2 deletions(-)
jump to
M
minim.nim
→
minim.nim
@@ -48,9 +48,14 @@ stderr.flushFile()
minimStream(stream, filename) proc completionCallback*(str: cstring, completions: ptr linenoiseCompletions) = + var words = ($str).split(" ") + var w = words.pop + var sep = "" + if words.len > 0: + sep = " " for s in SYMBOLS.keys: - if startsWith(s, $str): - linenoiseAddCompletion completions, s + if startsWith(s, w): + linenoiseAddCompletion completions, words.join(" ") & sep & s proc minimRepl*() = var i = newMinInterpreter(debugging)