aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/aerc.conf.in7
-rw-r--r--config/config.go2
-rw-r--r--doc/aerc-config.5.scd8
-rw-r--r--widgets/dirlist.go2
4 files changed, 18 insertions, 1 deletions
diff --git a/config/aerc.conf.in b/config/aerc.conf.in
index 3919b396..9f45883f 100644
--- a/config/aerc.conf.in
+++ b/config/aerc.conf.in
@@ -74,6 +74,13 @@ pinned-tab-marker='`'
# Default: %n %>r
dirlist-format=%n %>r
+# Delay after which the messages are actually listed when entering a directory.
+# This avoids loading messages when skipping over folders and makes the UI more
+# responsive. If you do not want that, set it to 0s.
+#
+# Default: 200ms
+dirlist-delay=200ms
+
# List of space-separated criteria to sort the messages by, see *sort*
# command in *aerc*(1) for reference. Prefixing a criterion with "-r "
# reverses that criterion.
diff --git a/config/config.go b/config/config.go
index 374fd5c7..e2acbaf3 100644
--- a/config/config.go
+++ b/config/config.go
@@ -47,6 +47,7 @@ type UIConfig struct {
Spinner string `ini:"spinner"`
SpinnerDelimiter string `ini:"spinner-delimiter"`
DirListFormat string `ini:"dirlist-format"`
+ DirListDelay time.Duration `ini:"dirlist-delay"`
Sort []string `delim:" "`
NextMessageOnDelete bool `ini:"next-message-on-delete"`
CompletionDelay time.Duration `ini:"completion-delay"`
@@ -564,6 +565,7 @@ func LoadConfigFromFile(root *string, sharedir string, logger *log.Logger) (*Aer
Spinner: "[..] , [..] , [..] , [..] , [..], [..] , [..] , [..] ",
SpinnerDelimiter: ",",
DirListFormat: "%n %>r",
+ DirListDelay: 200 * time.Millisecond,
NextMessageOnDelete: true,
CompletionDelay: 250 * time.Millisecond,
CompletionPopovers: true,
diff --git a/doc/aerc-config.5.scd b/doc/aerc-config.5.scd
index 89485b27..f40c9cb0 100644
--- a/doc/aerc-config.5.scd
+++ b/doc/aerc-config.5.scd
@@ -177,6 +177,14 @@ These options are configured in the *[ui]* section of aerc.conf.
| %>X
: make format specifier 'X' be right justified
+*dirlist-delay*
+ Delay after which the messages are actually listed when entering
+ a directory. This avoids loading messages when skipping over folders
+ and makes the UI more responsive. If you do not want that, set it to
+ 0s.
+
+ Default: 200ms
+
*next-message-on-delete*
Moves to next message when the current message is deleted
diff --git a/widgets/dirlist.go b/widgets/dirlist.go
index 53afc1dd..6f8869d5 100644
--- a/widgets/dirlist.go
+++ b/widgets/dirlist.go
@@ -96,7 +96,7 @@ func (dirlist *DirectoryList) Select(name string) {
go func() {
select {
- case <-time.After(1 * time.Second):
+ case <-time.After(dirlist.aercConf.Ui.DirListDelay):
dirlist.worker.PostAction(&types.OpenDirectory{Directory: name},
func(msg types.WorkerMessage) {
switch msg.(type) {