aboutsummaryrefslogtreecommitdiffstats
path: root/config/config.go
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2022-11-01 12:37:16 +0100
committerRobin Jarry <robin@jarry.cc>2022-11-06 23:16:08 +0100
commit6b0b5596dee5dda9fb367cbf8c82e52b9e6125a3 (patch)
tree9aeabf8ce24009bbdf28829647827951f21e425e /config/config.go
parent14ceca320065656ea31994191f9e74d254a72e04 (diff)
downloadaerc-6b0b5596dee5dda9fb367cbf8c82e52b9e6125a3.tar.gz
auto-completion: add option to require a min number of chars
When doing address completion via commands that take a while to run, having the completion trigger even with a single character can be non-optimal. Add an option to allow requiring a minimum number of characters to actually run the completion command. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
Diffstat (limited to 'config/config.go')
-rw-r--r--config/config.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/config/config.go b/config/config.go
index a15e1d51..5e5b49bc 100644
--- a/config/config.go
+++ b/config/config.go
@@ -71,6 +71,7 @@ type UIConfig struct {
Sort []string `delim:" "`
NextMessageOnDelete bool `ini:"next-message-on-delete"`
CompletionDelay time.Duration `ini:"completion-delay"`
+ CompletionMinChars int `ini:"completion-min-chars"`
CompletionPopovers bool `ini:"completion-popovers"`
StyleSetDirs []string `ini:"stylesets-dirs" delim:":"`
StyleSetName string `ini:"styleset-name"`
@@ -811,6 +812,7 @@ func LoadConfigFromFile(root *string, accts []string) (*AercConfig, error) {
DirListDelay: 200 * time.Millisecond,
NextMessageOnDelete: true,
CompletionDelay: 250 * time.Millisecond,
+ CompletionMinChars: 1,
CompletionPopovers: true,
StyleSetDirs: []string{},
StyleSetName: "default",