all repos — min @ 526e05a46dc171f590d080982ae4cf53bcf499d8

A small but practical concatenative programming language.

Improved file completion.
h3rald h3rald@h3rald.com
Sat, 10 Sep 2016 23:24:17 +0200
commit

526e05a46dc171f590d080982ae4cf53bcf499d8

parent

bb34820c285c69d119890fbc0fabc3898ab2a445

1 files changed, 10 insertions(+), 7 deletions(-)

jump to
M minim.nimminim.nim

@@ -73,14 +73,17 @@ return getExecs().mapIt("!" & $it[0])

if word.startsWith("&"): return getExecs().mapIt("&" & $it[0]) if word.startsWith("\""): - var dir = word[1..^1] - if dir.dirExists: - dir = dir.replace("\\", "/") + var f = word[1..^1] + if f == "": + f = getCurrentDir().replace("\\", "/") + return toSeq(f.walkDir).mapIt("\"$1\"" % it.path.replace("\\", "/")) + elif f.dirExists: + f = f.replace("\\", "/") + return toSeq(f.walkDir).mapIt("\"$1\"" % it.path.replace("\\", "/")) else: - dir = getCurrentDir().replace("\\", "/") - if not dir.endsWith("/"): - dir = dir & "/" - return toSeq(dir.walkDir).mapIt("\"$1\"" % it.path.replace("\\", "/")) + let dir = f.parentDir + if dir.existsDir: + return toSeq(dir.walkDir).filterIt(it.path.startsWith(f)).mapIt("\"$1\"" % it.path.replace("\\", "/")) return symbols proc stdLib(i: In) =