aboutsummaryrefslogtreecommitdiffstats
path: root/commands/compose/header.go
Commit message (Collapse)AuthorAgeFilesLines
* app: export global functionsRobin Jarry2023-10-101-4/+4
| | | | | | | | | | | | | | | The single Aerc object is passed around in almost all command functions. This hinders readability. Store the single Aerc instance as a global variable. Export public functions from the app package to access methods of that object. Remove all explicit references to *app.Aerc and replace them with calls to these functions. For references to private/unexported fields and functions from within the app package, directly access the global aerc object. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* widgets: rename package to appRobin Jarry2023-10-101-4/+4
| | | | | | | | | This is the central point of all aerc. Having it named widgets is confusing. Rename it to app. It will make a cleaner transition when making the app.Aerc object available globally in the next commit. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* compose: allow removing headersRobin Jarry2023-07-311-18/+26
| | | | | | | | Allow removing headers from the compose window when edit-headers=false (the default) with :header -d <name>. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Koni Marti <koni.marti@gmail.com>
* compose: implement embedded headers in editorKoni Marti2023-07-171-3/+1
| | | | | | | | | Implement embedded header mode in the composer widget. To activate it, use set [compose].edit-headers=true in aerc.conf. Signed-off-by: Koni Marti <koni.marti@gmail.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
* lint: homogenize operations and minor fixes (gocritic)Moritz Poldrack2022-08-041-2/+1
| | | | | | | | | | | | | | | | | | Apply GoDoc comment policy (comments for humans should have a space after the //; machine-readable comments shouldn't) Use strings.ReplaceAll instead of strings.Replace when appropriate Remove if/else chains by replacing them with switches Use short assignment/increment notation Replace single case switches with if statements Combine else and if when appropriate Signed-off-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* lint: apply new formatting rulesMoritz Poldrack2022-08-011-14/+10
| | | | | | | Run `make fmt`. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* tabs: rename SelectedTab to SelectedTabContentRobin Jarry2022-07-231-1/+1
| | | | | | | | | This function returns an ui.Drawable. Use a more explicit name. This prepares for adding a new SelectedTab function which will return an ui.Tab. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Koni Marti <koni.marti@gmail.com>
* fix: out-of-bounds error in command headerMoritz Poldrack2022-04-061-0/+6
| | | | | | | | This commit fixes an out-of-bound error that happened while parsing commands. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* header: remove trailing colon in header fieldMoritz Poldrack2022-04-061-0/+2
| | | | | | | | With this commit trailing colons in the :header command's field are removed to prevent double-colon-headers from being sent. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* commands: implement fuzzy completion for commands and optionskt programs2022-03-071-1/+1
| | | | | | | | Change the option to enable fuzzy completion to be fuzzy-complete, since it's no longer only used for folders Signed-off-by: Kt Programs <ktprograms@gmail.com> Acked-by: Koni Marti <koni.marti@gmail.com>
* go.mod: change base git urlRobin Jarry2021-11-051-2/+2
| | | | | | | 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>
* allow the loading of existing headersReto Brunner2020-11-141-2/+4
|
* compose: use a proper header instead of a string mapReto Brunner2020-11-141-4/+3
| | | | | | | | | | | | | 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.
* Implement :header commandRay Ganardi2020-05-011-0/+74
Usage: *header* [-f] <field> [value] Add a new email header. If the header already exists, -f must be specified to replace the given value.