From 61d9904ba1f47bf5bbd3497ac0c9f5787adb8633 Mon Sep 17 00:00:00 2001 From: Eyal Posener Date: Mon, 15 May 2017 23:52:04 +0300 Subject: Fix './' prefix for file completion --- match/file.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'match') 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) } -- cgit v1.2.3