Add trailing slash when completing directories

This commit is contained in:
LemonBoy 2019-07-03 18:12:15 +02:00 committed by zah
parent 4eed0d8695
commit 41eda1ac5b
1 changed files with 5 additions and 1 deletions

View File

@ -275,7 +275,11 @@ proc completeCmdArg*(T: type[InputFile|InputDir], val: TaintedString): seq[strin
type(T) is InputDir and kind in {pcDir, pcLinkToDir}:
# Note, no normalization is needed here
if path.startsWith(tail):
result.add(dir / path)
if type(T) is InputDir:
# Add a trailing slash so that completions can be chained
result.add(dir / path & '/')
else:
result.add(dir / path)
proc completeCmdArg*(T: type[OutFile|OutDir|OutPath], val: TaintedString): seq[string] =
return @[]