diff options
author | Robin Jarry <robin@jarry.cc> | 2023-10-30 21:05:56 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-11-02 11:59:39 +0100 |
commit | 2dfeb7130a8fb97d927a55efa738f110f46cb688 (patch) | |
tree | cca6a06999d2be32f01e4ac6ae2998c5f24c2895 /commands/msg | |
parent | faa879f9a84d44f9b251410fc923a827a44df1a7 (diff) | |
download | aerc-2dfeb7130a8fb97d927a55efa738f110f46cb688.tar.gz |
completion: refactor filter list api
Remove CompletionFromList which is a trivial wrapper around FilterList.
Remove the prefix, suffix and isFuzzy arguments from FilterList.
Replace prefix, suffix by an optional callback to allow post processing
of completion results before presenting them to the user.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Inwit <inwit@sindominio.net>
Diffstat (limited to 'commands/msg')
-rw-r--r-- | commands/msg/archive.go | 2 | ||||
-rw-r--r-- | commands/msg/read.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/commands/msg/archive.go b/commands/msg/archive.go index 34cba8b8..5c97e2da 100644 --- a/commands/msg/archive.go +++ b/commands/msg/archive.go @@ -43,7 +43,7 @@ func (Archive) Aliases() []string { } func (*Archive) CompleteType(arg string) []string { - return commands.CompletionFromList(ARCHIVE_TYPES, arg) + return commands.FilterList(ARCHIVE_TYPES, arg, nil) } func (a Archive) Execute(args []string) error { diff --git a/commands/msg/read.go b/commands/msg/read.go index 72159a53..a92a4d0a 100644 --- a/commands/msg/read.go +++ b/commands/msg/read.go @@ -46,7 +46,7 @@ func (f *FlagMsg) ParseFlag(arg string) error { var validFlags = []string{"seen", "answered", "flagged"} func (*FlagMsg) CompleteFlag(arg string) []string { - return commands.CompletionFromList(validFlags, arg) + return commands.FilterList(validFlags, arg, nil) } // If this was called as 'flag' or 'unflag', without the toggle (-t) |