From 7160f98a9081bcab05904484eae790ec0a006b87 Mon Sep 17 00:00:00 2001 From: Ben Burwell Date: Fri, 20 Dec 2019 13:21:33 -0500 Subject: 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. --- config/aerc.conf.in | 11 +++++++++++ config/config.go | 35 ++++++++++++++++++++--------------- 2 files changed, 31 insertions(+), 15 deletions(-) (limited to 'config') 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{ -- cgit 1.4.1-2-gfad0 b523 ^
d0db566 ^



d0db566 ^
1fd1e30 ^
d0db566 ^























464b523 ^
1fd1e30 ^
464b523 ^










1fd1e30 ^

464b523 ^
d0db566 ^
58921d5 ^
d0db566 ^




1f8a397 ^
464b523 ^

d0db566 ^





6567bdb ^



d0db566 ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69