summaryrefslogtreecommitdiff
path: root/match/file.go
diff options
context:
space:
mode:
Diffstat (limited to 'match/file.go')
-rw-r--r--match/file.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/match/file.go b/match/file.go
index eee5bec..051171e 100644
--- a/match/file.go
+++ b/match/file.go
@@ -4,13 +4,16 @@ import "strings"
// File returns true if prefix can match the file
func File(file, prefix string) bool {
-
// special case for current directory completion
if file == "./" && (prefix == "." || prefix == "") {
return true
}
+ if prefix == "." && strings.HasPrefix(file, ".") {
+ return true
+ }
file = strings.TrimPrefix(file, "./")
prefix = strings.TrimPrefix(prefix, "./")
+
return strings.HasPrefix(file, prefix)
}