summaryrefslogtreecommitdiff
path: root/option.go
diff options
context:
space:
mode:
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:], "/"))
}