Skip to content

Commit fd4591c

Browse files
committed
Improved auto-completion for files and folders.
1 parent 854ee0f commit fd4591c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

minpkg/core/shell.nim

+4-4
Original file line numberDiff line numberDiff line change
@@ -94,24 +94,24 @@ proc getCompletions*(ed: LineEditor, i: MinInterpreter): seq[string] =
9494
var f = word[1..^1]
9595
if f == "":
9696
f = getCurrentDir().replace("\\", "/")
97-
return toSeq(walkDir(f, true)).mapIt("\"$1" % it.path.replace("\\", "/"))
97+
return toSeq(walkDir(f, true)).mapIt("\"$1" % it.path.replace("\\", "/")&"\"")
9898
elif f.dirExists:
9999
f = f.replace("\\", "/")
100100
if f[f.len-1] != '/':
101101
f = f & "/"
102-
return toSeq(walkDir(f, true)).mapIt("\"$1$2" % [f, it.path.replace("\\", "/")])
102+
return toSeq(walkDir(f, true)).mapIt("\"$1$2\"" % [f, it.path.replace("\\", "/")])
103103
else:
104104
var dir: string
105105
if f.contains("/") or dir.contains("\\"):
106106
dir = f.parentDir
107107
let file = f.extractFileName
108108
return toSeq(walkDir(dir, true)).filterIt(
109109
it.path.toLowerAscii.startsWith(file.toLowerAscii)).mapIt(
110-
"\"$1/$2" % [dir, it.path.replace("\\", "/")])
110+
"\"$1/$2\"" % [dir, it.path.replace("\\", "/")])
111111
else:
112112
dir = getCurrentDir()
113113
return toSeq(walkDir(dir, true)).filterIt(
114-
it.path.toLowerAscii.startsWith(f.toLowerAscii)).mapIt("\"$1" % [
114+
it.path.toLowerAscii.startsWith(f.toLowerAscii)).mapIt("\"$1\"" % [
115115
it.path.replace("\\", "/")])
116116
return symbols
117117

next-release.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
### BREAKING CHANGES
22

33
* SSL is now enabled by default when installing via nimble and when compiling by default. Use `-d:nossl` to disable.
4-
* The min shell no longer attempts to auto-complete executables (it never worked properly anyway).
54

65
### New Features
76

@@ -12,4 +11,6 @@
1211

1312
### Fixes and Improvements
1413

14+
* Auto-completions for files and folders now automatically end with `"`.
15+
* The min shell no longer attempts to auto-complete executables (it never worked properly anyway).
1516

0 commit comments

Comments
 (0)