Improved file completions.
h3rald h3rald@h3rald.com
Sun, 18 Sep 2016 11:07:33 +0200
1 files changed,
6 insertions(+),
3 deletions(-)
jump to
M
minim.nim
→
minim.nim
@@ -77,14 +77,17 @@ if word.startsWith("\""):
var f = word[1..^1] if f == "": f = getCurrentDir().replace("\\", "/") - return toSeq(f.walkDir).mapIt("\"$1\"" % it.path.replace("\\", "/")) + return toSeq(walkDir(f, true)).mapIt("\"$1\"" % it.path.replace("\\", "/")) elif f.dirExists: f = f.replace("\\", "/") - return toSeq(f.walkDir).mapIt("\"$1\"" % it.path.replace("\\", "/")) + if f[f.len-1] != '/': + f = f & "/" + return toSeq(walkDir(f, true)).mapIt("\"$1$2\"" % [f, it.path.replace("\\", "/")]) else: let dir = f.parentDir + let file = f.extractFileName if dir.existsDir: - return toSeq(dir.walkDir).filterIt(it.path.startsWith(f)).mapIt("\"$1\"" % it.path.replace("\\", "/")) + return toSeq(walkDir(dir, true)).filterIt(it.path.startsWith(file)).mapIt("\"$1/$2\"" % [dir, it.path.replace("\\", "/")]) return symbols proc stdLib(i: In) =