aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/aerc.go
Commit message (Collapse)AuthorAgeFilesLines
* aerc: use contextual ui styleset for tabs/composeKoni Marti2022-04-171-4/+14
| | | | | | | | | Use contextual ui styleset for tabs and compose widgets. If no account is selected, use default styleset as fallback. Fixes: https://todo.sr.ht/~rjarry/aerc/3 Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* statusline: improve status line updatingKoni Marti2022-03-251-0/+3
| | | | | | | | | | | | Update statusline only for the selected account (to prevent other updates from different accounts to interfere). Update status when jumping/selecting/closing tabs. Fixes cosmetic regressions introduced by commit feecc09b73e2 ("statusline: make statusline folder-specific"). Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* logging: fix race condition in startupMoritz Poldrack2022-03-241-3/+3
| | | | | | | | | If a panic occurs in one of the workers, it can happen after the UI was initialised, but before the cleanup function has been registered. With this the start of the worker loops is deferred until the cleanup routine was registered. Signed-off-by: Moritz Poldrack <git@moritz.sh>
* compose: make headerEditor focusing more reliableTim Culverhouse2022-03-221-2/+2
| | | | | | | | | | | | Focusing header editors was hardcoded as integers which only worked with the default ui. If a user changed the UI to, for example, put CC as a field below "to", FocusSubject would focus the CC field instead of the subject. This commit reuses and modifies the function FocusEditor to generalize the focusing of header editors - which can now be called by name via FocusEditor(name string) Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* statusline: implement per-account statusKoni Marti2022-03-181-5/+9
| | | | | | | | | | | | | | | | Implement a statusline state for each account. Keep the ex line and the push notifications global. Add account name prefix to push notifications. Prefix status line with account name when multiple accounts are available. Use account-specific status line for each tab where an account is defined. Handle threading, filter/search, viewer passthrough and connection status. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* mailto: handle bcc and body fieldsTim Culverhouse2022-03-181-0/+10
| | | | | | | Enable handling of bcc and body fields in mailto links Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* go vet: composite literal uses unkeyed fieldsMoritz Poldrack2022-03-181-8/+8
| | | | | | | | This commit fixes all occurrences of the abovementioned lint-error in the codebase. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* mailto: allow empty recipient fieldTim Culverhouse2022-03-181-1/+4
| | | | | | | | Allow a mailto link to open a new composer even if no recipient is in the url. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Moritz Poldrack <git@moritz.sh>
* viewer: add key passthrough modekt programs2022-03-141-1/+6
| | | | | | | | | | | | | | | | When trying to search in less, keys bound to viewer functions can't be used as part of the search query, which makes the search useless. Add a view::passthrough binding mode and a :toggle-key-passthrough command go toggle in and out of that mode. By default, typing '/' in the viewer is bound to enabling key passthrough and automatically inserting '/', to easily enter "less" search mode. When in the passthrough mode, all bindings are ignored by default. The default binds.conf only defines a single keybinding in that mode: <Esc> to get back out. $ex is bound to <C-x> to allow typing colons. Signed-off-by: Kt Programs <ktprograms@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* all: fix minor issues found by staticcheckMoritz Poldrack2022-03-121-3/+0
| | | | Signed-off-by: Moritz Poldrack <git@moritz.sh>
* aerc: always check SelectedAccount return valueRobin Jarry2022-02-251-0/+8
| | | | | | | | | | | | | | | | aerc.SelectedAccount() is used in lots of places. Most of them without checking the return value. In some cases, the currently selected tab is not related to any account (widget.Terminal for example). This can lead to unexpected crashes when accessing account specific configuration. When possible, return an error when no account is currently selected. If no error can be returned, fallback to non-account specific configuration. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Koni Marti <koni.marti@gmail.com>
* search/filter: display in extra statusRobin Jarry2022-02-231-0/+8
| | | | | | | | | | Add an extra attribute to the status line. When non-empty, display it after the current status. Set that extra status after a successful :search or :filter. Remove it after :clear. Signed-off-by: Robin Jarry <robin@jarry.cc>
* completions: add support for completing multiple addressesParasrah2022-01-071-6/+6
| | | | | | | as per the discussion https://lists.sr.ht/~sircmpwn/aerc/patches/15367 this handles completions in `completer/completer.go` by enabling the completer to return a `prefix` that will be prepended to the selected completion candidate.
* pgp: update openpgp packages (go-crypto and go-pgpmail)Koni Marti2022-01-071-1/+1
| | | | | | | Replaces golang.org/x/crypto with github.com/ProtonMail/go-crypto consistently and updates go-pgpmail to v0.2.0 Signed-off-by: Koni Marti <koni.marti@gmail.com>
* binds: add account specific bindingsJonathan Bartlett2021-12-111-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using aerc for multiple accounts often bindings might differ slightly between accounts. For example: * Account A archives to one directory (:archive) * Account B archives to monthly directories (:archive month) Add account specific bindings to allow the user to add a "context" to a binding group using a context specifier and a regular expression. Currently the only context specifier is 'account'. The regular expression is validated against the accounts loaded from accounts.conf and the configuration fails to load if there are no matches. Contextual bindings are merged with global bindings, with contextual bindings taking precedence, when that context is active. Bindings are be configured using a generic pattern of 'view:context=regexp'. E.g.: # Globally Applicable Archiving [messages] A = :read<Enter>:archive<Enter> # Monthly Archiving for 'Mailbox' Account [messages:account=Mailbox$] A = :read<Enter>:archive month<Enter> In the above example all accounts matching the regular expression will archive in the monthly format - all others will use the global binding. Signed-off-by: Jonathan Bartlett <jonathan@jonnobrow.co.uk>
* go.mod: change base git urlRobin Jarry2021-11-051-4/+4
| | | | | | | I'm not sure what are the implications but it seems required. Link: https://github.com/golang/go/issues/20883 Signed-off-by: Robin Jarry <robin@jarry.cc>
* view,compose: use border color to separate headers from bodyRobin Jarry2021-10-281-4/+4
| | | | | | | | | | When composing a message, there is an empty fill line between the headers and the text editor. The line is printed with the default style which may cause users to assume it is part of the editor. Display the fill lines with the border color to avoid confusion. Signed-off-by: Robin Jarry <robin@jarry.cc>
* bindings: prepare for more modifersRobin Jarry2021-10-281-0/+1
| | | | | | | | | | | | | | | | Prepare to support more modifiers in key bindings. tcell has some premade ctrl-modified keys but not all keys are supported. Other keys must be explicitly checked with a modifier mask. Update the KeyStroke type to carry a modifier mask. Update code accordingly. No functional change. Link: https://github.com/gdamore/tcell/blob/master/key.go#L265-L275 Link: https://github.com/gdamore/tcell/blob/master/key.go#L384-L419 Signed-off-by: Robin Jarry <robin@jarry.cc>
* Get rid of the aerc.PushError(" " + $string) idiomReto Brunner2021-01-301-4/+4
| | | | The individual callers should not be responsible for padding
* trim <> from messageIDs when handling mailto linksReto Brunner2021-01-121-0/+6
| | | | Co-authored-by: James Walmsley <james@fullfat-fs.co.uk>
* update tcell to v2 and enable TrueColor supporty0ast2020-12-181-1/+1
| | | | | | | | | Also update to the tcell v2 PaletteColor api, which should keep the chosen theme of the user intact. Note, that if $TRUECOLOR is defined and a truecolor given, aerc will now stop clipping the value to one of the theme colors. Generally this is desired behaviour though.
* fix mailto parsingReto Brunner2020-11-281-1/+5
|
* compose: use a proper header instead of a string mapReto Brunner2020-11-141-12/+24
| | | | | | | | | | | | | Prior to this commit, the composer was based on a map[string]string. While this approach was very versatile, it lead to a constant encoding / decoding of addresses and other headers. This commit switches to a different model, where the composer is based on a header. Commands which want to interact with it can simply set some defaults they would like to have. Users can overwrite them however they like. In order to get access to the functions generating / getting the msgid go-message was upgraded.
* show error if account view creation failsReto Brunner2020-08-101-3/+24
| | | | | | | | This can happen for example if aerc is compiled without notmuch support but the notmuch worker is requested. Pushing a status message isn't good enough, as this gets overridden pretty quickly if one has multiple accounts configured. So we show a fullscreen error instead.
* Implement style configuration.Kalyan Sriram2020-08-061-6/+14
| | | | | | Introduce the ability to configure stylesets, allowing customization of aerc's look (color scheme, font weight, etc). Default styleset is installed to /path/to/aerc/stylesets/default.
* Revert "Implement style configuration."Reto Brunner2020-07-301-14/+6
| | | | This reverts commit 1ff687ca2b0821c2cacc1fa725abb3302d2af9da.
* Implement style configuration.Kalyan Sriram2020-07-301-6/+14
| | | | | | Introduce the ability to configure stylesets, allowing customization of aerc's look (color scheme, font weight, etc). Default styleset is installed to /path/to/aerc/stylesets/default.
* Make grid sizes dynamicJeffas2020-06-091-5/+4
| | | | | | | | | The grid used static sizes which meant that changing settings didn't have an effect on elements of the ui, notably the sidebar width. This patch makes the `Size` parameter of a cell a function which returns the `int`, allowing for dynamic sizes. A `Const` function is also included for ease of use for static sizes.
* Revert "Add Style configuration"Drew DeVault2020-05-281-18/+11
| | | | This reverts commit 0f78f06610c0e8887aba2ae50e99b86477a384b3.
* Revert "Remove duration from the status methods"Drew DeVault2020-05-281-10/+10
| | | | This reverts commit f06d683688e3d2139b14f67b7e349089e7200bf4.
* Remove duration from the status methodsReto Brunner2020-05-271-10/+10
| | | | We always set 10 seconds anyhow, might as well do that without repeating ourselfs.
* Add Style configurationReto Brunner2020-05-271-11/+18
| | | | | | | | | | The following functionalities are added to configure aerc ui styles. - Read stylesets from file with very basic fnmatch wildcard matching - Add default styleset - Support different stylesets as part of UiConfig allowing contextual styles. - Move widgets/ui elements to use the stylesets. - Add configuration manual for the styleset
* aerc: Refactor getpasswd dialogRay Ganardi2020-05-251-30/+53
| | | | | | Previously there's a hack for showing and hiding the dialog. Change it to use channels to emulate async/await
* feat(pgp): Show error message from pgpRay Ganardi2020-05-251-1/+4
| | | | | The error wasn't shown, making errors like wrong password being ignored and the password is prompted again.
* feat(pgp): Add <ESC> to cancel password promptRay Ganardi2020-05-251-7/+11
| | | | Previously there was no way to cancel the password prompt.
* gofmt fixesDrew DeVault2020-04-241-4/+4
|
* Add postpone commandJeffas2020-04-241-1/+3
| | | | | | | This command uses the Postpone folder from the account config to save messages to. Messages are saved as though they were sent so have a valid 'to' recipient address and should be able to be read back in for later editing.
* Add :choose commandRay Ganardi2020-04-241-0/+33
| | | | | | | Usage: *choose* -o <key> <text> <command> [-o <key> <text> <command>]... Prompts the user to choose from various options.
* Use aerc.PushError where appropriateBen Fiedler2020-04-231-6/+3
| | | | Forgot an unused import, to save you the hassle here is v2.
* Add pinned tabsJeffas2020-03-091-1/+9
| | | | | | This adds the commands pin-tab and unpin-tab. Once pinned a tab lives on the left of the tabstrip and has a configurable marker, defaulting to ` before its name.
* Reduce size of the password prompt UIDrew DeVault2020-03-031-2/+2
|
* Initial support for PGP decryption & signaturesDrew DeVault2020-03-031-0/+48
|
* Add move-tab commandJeffas2020-03-031-0/+12
|
* create OriginalMail structLeszek CimaƂa2020-01-091-1/+2
|
* Show textinput completions in popoversBen Burwell2019-12-211-2/+2
| | | | | | 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.
* Add UI options to save/pipe messages with unsupported mimetypesGreg Anders2019-11-171-3/+3
| | | | | | | | | | | | | | | Adds a message indicating the user's ability to :save or :pipe a message with an unsupported mimetype and also adds a selector widget (similar to the tutorial). The selector widget was previously defined in the account wizard module, so this commit breaks it out into its own module to allow for re-use. Further, modify the BeginExLine() function to take an argument that pre-populates the command line, allowing functions to initiate an ex command without executing it. Closes #95.
* Add Templates with ParsingSrivathsan Murali2019-11-101-2/+5
| | | | | | | | | | | | | | | + Changes NewComposer to return error. + Add lib to handle templates using "text/template". + Add -T option to following commands - compose. - reply - forward + Quoted replies using templates. + Forwards as body using templates + Default templates are installed similar to filters. + Templates Config in aerc.conf. - Required templates are parsed while loading config. + Add aerc-templates.7 manual for using template data.
* Fix selected account to return for messageviewerJeffas2019-10-021-4/+6
| | | | | | This ensures that the selectedaccount is returned if currently selected tab is a messageviewer. This also makes it more extensible for adding other ways of getting the selected account.
* widgets: remove duplicate importWagner Riffel2019-09-121-18/+17
| | | | Signed-off-by: Wagner Riffel <wgrriffel@gmail.com>
* Add signaturesJeffas2019-09-121-1/+1
| | | | | | | | | | | | | This adds the ability for per-account signatures in the accounts.conf config file. The signature is added to emails in the editor at the bottom of the email. This includes when forwarding, replying to, and composing emails. There are two config options: signature-file and signature-cmd. The former allows a signature to be read from a file and the latter allows an arbitrary command to be executed to return the signature. The config options have been documented in aerc-config