diff options
author | Robin Jarry <robin@jarry.cc> | 2022-01-28 10:17:13 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-01-29 22:01:25 +0100 |
commit | a5c046efe3af8f1b3c94c9d83c214c77fa9f6697 (patch) | |
tree | cd7bb3950d7c0c87a671d01a07293f1ab0bcc3e8 /config | |
parent | cdec23323c644b1805ca9cca138e7fa91be6ab6d (diff) | |
download | aerc-a5c046efe3af8f1b3c94c9d83c214c77fa9f6697.tar.gz |
dirlist: use shorter delay before listing directory contents
1 second is a bit excessive. Use 200ms which should cover most quick
folder changes.
Add an option to make that delay configurable by the users.
References: https://todo.sr.ht/~rjarry/aerc/16
Fixes: cb3090956cfd ("dirlist: skip unnecessary change-folder action")
Suggested-by: Koni Marti <koni.marti@gmail.com>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'config')
-rw-r--r-- | config/aerc.conf.in | 7 | ||||
-rw-r--r-- | config/config.go | 2 |
2 files changed, 9 insertions, 0 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, |