Refactor FilePathCompleter
This commit is contained in:
parent
f119db91a1
commit
d360b4d498
@ -16,7 +16,7 @@ func executor(in string) {
|
||||
func main() {
|
||||
c := completer.FilePathCompleter{
|
||||
IgnoreCase: true,
|
||||
Filter: func(fi os.FileInfo, filename string) bool {
|
||||
Filter: func(fi os.FileInfo) bool {
|
||||
return fi.IsDir() || strings.HasSuffix(fi.Name(), ".go")
|
||||
},
|
||||
}
|
||||
|
@ -16,8 +16,10 @@ var (
|
||||
)
|
||||
|
||||
// FilePathCompleter is a completer for your local file system.
|
||||
// Please caution that you need to set OptionCompletionWordSeparator(completer.FilePathCompletionSeparator)
|
||||
// when you use this completer.
|
||||
type FilePathCompleter struct {
|
||||
Filter func(fi os.FileInfo, filename string) bool
|
||||
Filter func(fi os.FileInfo) bool
|
||||
IgnoreCase bool
|
||||
fileListCache map[string][]prompt.Suggest
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user