summaryrefslogtreecommitdiff
path: root/option.go
diff options
context:
space:
mode:
authorEyal Posener <[email protected]>2017-05-05 23:07:18 +0300
committerEyal Posener <[email protected]>2017-05-05 23:07:18 +0300
commitc8263230e11aa755d3b0b964d4bf7ff296661f5e (patch)
tree257d6dfb9218ad536d3b20956b499f2b74ef271c /option.go
parent04d16f6064c7c71068f47b4e7106f15a05b6b326 (diff)
Add additional args
add predition of directories add ability for prediction union
Diffstat (limited to 'option.go')
-rw-r--r--option.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/option.go b/option.go
index 9333e84..6a067ea 100644
--- a/option.go
+++ b/option.go
@@ -35,5 +35,8 @@ func (a ArgFileName) Matches(prefix string) bool {
if err != nil {
logger("failed getting abs path of %s: %s", prefix, err)
}
- return strings.HasPrefix(full, prefixFull)
+
+ // if the file has the prefix as prefix,
+ // but we don't want to show too many files, so, if it is in a deeper directory - omit it.
+ return strings.HasPrefix(full, prefixFull) && (full == prefixFull || !strings.Contains(full[len(prefixFull)+1:], "/"))
}