aboutsummaryrefslogtreecommitdiffstats
path: root/config/viewer.go
Commit message (Collapse)AuthorAgeFilesLines
* config: update default pagerMoritz Poldrack2023-05-161-1/+1
| | | | | | | | | | | Since aercs embedded terminal now behaves correctly, a messages contents are at the bottom of the pager by default, this has already sparked confusion as this is uncommon and not matching previous behaviour. Thanks: Stacy Harper <contact@stacyharper.net> Suggested-by: Tim Culverhouse <tim@timculverhouse.com> Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* config: use reflection to map ini keys to struct fieldsRobin Jarry2023-03-021-37/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default ini.Section.MapTo() function only handles basic types. Implement a more complete mapping solution that allows: * parsing templates, regexps, email addresses * defining a custom parsing method via the `parse:"MethodName"` tag * defining default values via the `default:"value"` tag * parsing rune values with the `type:"rune"` tag The field name must be specified in the `ini:"field-name"` tag as it was before. It is no longer optional. The `delim:"<separator>"` tag remains but can only be used to parse string arrays. It is now possible to override default values with "zero" values. For example: [ui] dirlist-delay = 0 Will override the default "200ms" value. Also: [statusline] status-columns = Will override the default "left<*,center>=,right>*" value. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* reply: refactor close-on-reply setting to -c flagBence Ferdinandy2022-12-151-2/+0
| | | | | | | | Previously close-on-reply was implemented as a setting, making it unflexible. Refactor so it is a flag to reply `:reply -c`. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* config: make various sections accessible via global varsRobin Jarry2022-12-141-7/+9
| | | | | | | | | | | | | | | | | | | | There is only one instance of AercConfig which is associated to the Aerc widget. Everywhere we need to access configuration options, we need somehow to get a reference either to the Aerc widget or to a pointer to the AercConfig instance. This makes the code cluttered. Remove the AercConfig structure and every place where it is referenced. Instead, declare global variables for every configuration section and access them directly from the `config` module. Since bindings and ui sections can be "contextual" (i.e. per account, per folder or per subject), leave most local references intact. Replacing them with config.{Ui,Binds}.For{Account,Folder,Subject} would make this patch even more unreadable. This is something that may be addressed in the future. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* view: add close-on-reply optionBence Ferdinandy2022-12-021-0/+2
| | | | | | | | | | | Opening an email to view and then to reply will have two tabs open, and after a reply the view tab needs to be closed manually. Allow the user to set a close-on-reply option that will close the viewer tab when replying and reopen the viewer tab in case the reply is not sent. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Tested-by: Inwit <inwit@sindominio.net> Signed-off-by: Robin Jarry <robin@jarry.cc>
* logging: rename package to logRobin Jarry2022-12-021-2/+2
| | | | | | | | | | Use the same name than the builtin "log" package. That way, we do not risk logging in the wrong place. Suggested-by: Tim Culverhouse <tim@timculverhouse.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* config: move [viewer] parsing in separate fileRobin Jarry2022-11-161-0/+54
The config.go file is getting too big. Move the aerc.conf [viewer] section parsing logic into a dedicated viewer.go file. No functional change. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>