aboutsummaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorBen Burwell <ben@benburwell.com>2019-12-20 13:21:33 -0500
committerDrew DeVault <sir@cmpwn.com>2019-12-21 09:23:21 -0500
commit7160f98a9081bcab05904484eae790ec0a006b87 (patch)
treee35712afd3dcec12efd47a89d8e4f652fab9cca1 /config
parentbcd03c4c4a94e73b2545bf5dfc404082a674c76e (diff)
Show textinput completions in popovers
Rather than showing completions inline in the text input, show them in a popover which can be scrolled by repeatedly pressing the tab key. The selected completion can be executed by pressing enter.
Diffstat (limited to 'config')
-rw-r--r--config/aerc.conf.in11
-rw-r--r--config/config.go35
2 files changed, 31 insertions, 15 deletions
diff --git a/config/aerc.conf.in b/config/aerc.conf.in
index 16e3da1..660a525 100644
--- a/config/aerc.conf.in
+++ b/config/aerc.conf.in
@@ -99,6 +99,17 @@ header-layout=From|To,Cc|Bcc,Date,Subject
# Default: false
always-show-mime=false
+# How long to wait after the last input before auto-completion is triggered.
+#
+# Default: 250ms
+completion-delay=250ms
+
+#
+# Global switch for completion popovers
+#
+# Default: true
+completion-popovers=true
+
[compose]
#
# Specifies the command to run the editor with. It will be shown in an embedded
diff --git a/config/config.go b/config/config.go
index dd1f5f4..d6afef6 100644
--- a/config/config.go
+++ b/config/config.go
@@ -11,6 +11,7 @@ import (
"regexp"
"sort"
"strings"
+ "time"
"unicode"
"github.com/gdamore/tcell"
@@ -25,21 +26,23 @@ type GeneralConfig struct {
}
type UIConfig struct {
- IndexFormat string `ini:"index-format"`
- TimestampFormat string `ini:"timestamp-format"`
- ShowHeaders []string `delim:","`
- RenderAccountTabs string `ini:"render-account-tabs"`
- SidebarWidth int `ini:"sidebar-width"`
- PreviewHeight int `ini:"preview-height"`
- EmptyMessage string `ini:"empty-message"`
- EmptyDirlist string `ini:"empty-dirlist"`
- MouseEnabled bool `ini:"mouse-enabled"`
- NewMessageBell bool `ini:"new-message-bell"`
- Spinner string `ini:"spinner"`
- SpinnerDelimiter string `ini:"spinner-delimiter"`
- DirListFormat string `ini:"dirlist-format"`
- Sort []string `delim:" "`
- NextMessageOnDelete bool `ini:"next-message-on-delete"`
+ IndexFormat string `ini:"index-format"`
+ TimestampFormat string `ini:"timestamp-format"`
+ ShowHeaders []string `delim:","`
+ RenderAccountTabs string `ini:"render-account-tabs"`
+ SidebarWidth int `ini:"sidebar-width"`
+ PreviewHeight int `ini:"preview-height"`
+ EmptyMessage string `ini:"empty-message"`
+ EmptyDirlist string `ini:"empty-dirlist"`
+ MouseEnabled bool `ini:"mouse-enabled"`
+ NewMessageBell bool `ini:"new-message-bell"`
+ Spinner string `ini:"spinner"`
+ SpinnerDelimiter string `ini:"spinner-delimiter"`
+ DirListFormat string `ini:"dirlist-format"`
+ Sort []string `delim:" "`
+ NextMessageOnDelete bool `ini:"next-message-on-delete"`
+ CompletionDelay time.Duration `ini:"completion-delay"`
+ CompletionPopovers bool `ini:"completion-popovers"`
}
const (
@@ -387,6 +390,8 @@ func LoadConfigFromFile(root *string, sharedir string) (*AercConfig, error) {
SpinnerDelimiter: ",",
DirListFormat: "%n %>r",
NextMessageOnDelete: true,
+ CompletionDelay: 250 * time.Millisecond,
+ CompletionPopovers: true,
},
Viewer: ViewerConfig{