aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
Commit message (Collapse)AuthorAgeFilesLines
* Parse headers from templateRobert Günzler2019-12-041-3/+39
| | | | | | | | | | | Parse the processed template for headers and populates matching header editors accordingly. Those are then stripped from the template body before prepending it and remaining header fields to the composer content. The motivation for this is keeping receiver, sender and subject lines in the template file and generating the message subject with the date functions.
* widgets/terminal: Reap more zombiesKevin Kuehler2019-11-211-0/+1
| | | | | | | The editor and pager were not properly being reaped, causing resource leakage whenever a user replies to a message. Signed-off-by: Kevin Kuehler <keur@xcf.berkeley.edu>
* Allow fields in compose widget to be clickedGreg Anders2019-11-171-2/+32
| | | | | When the mouse is enabled, clicking on a header field switches focus to that field (likewise for the terminal).
* Complete the F rune.Srivathsan Murali2019-11-171-0/+1
| | | | | %F now shows the auth name or recepient name/address if the message is from you.
* Add UI options to save/pipe messages with unsupported mimetypesGreg Anders2019-11-176-122/+161
| | | | | | | | | | | | | | | 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.
* Check for terminal before forwarding mouse eventGreg Anders2019-11-171-1/+1
| | | | | | | When viewing a message part with no available filter, clicking the UI would cause a nil pointer dereference because the MouseEvent was passed to the PartViewer's `term` field, which does not exist in the case of an absent filter.
* Add some defaults for template optionsDrew DeVault2019-11-101-2/+4
|
* Add Templates with ParsingSrivathsan Murali2019-11-102-5/+39
| | | | | | | | | | | | | | | + 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.
* widgets/msgviewer: Don't crash if pager is nilKevin Kuehler2019-11-101-1/+1
| | | | Signed-off-by: Kevin Kuehler <keur@xcf.berkeley.edu>
* widgets/msgview: Reap the filter commandKevin Kuehler2019-10-161-0/+1
| | | | | | | | The filter command shells out and returns almost immediately. Call Wait() so the filter process gets reaped. Prior to this patch, aerc creates a zombie process for every email that is viewed. Signed-off-by: Kevin Kuehler <keur@xcf.berkeley.edu>
* Cleanup pager processes after closing a msgviewerKevin Kuehler2019-10-161-0/+17
| | | | | | | | | A pager is spawned every time an email is viewed but not killed off when quitting the msgviewer, thus leading to process leakage. This patch fixes this by adding a Close method to the msgview widget, which is called in the close command. Signed-off-by: Kevin Kuehler <keur@xcf.berkeley.edu>
* Revert "Show spinner when fetching contents"Drew DeVault2019-10-091-3/+0
| | | | This reverts commit 1339faf7881f33762c6e0a4915404e362fc51de1.
* Show spinner when fetching contentsJeffas2019-10-091-0/+3
| | | | | The spinner should be shown when fetching the contents as we don't know at that point whether there are some messages or not.
* 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.
* Add sorting functionalityJeffas2019-09-201-0/+14
| | | | | | | | There is a command and config option. The criteria are a list of the sort criterion and each can be individually reversed. This only includes support for sorting in the maildir backend currently. The other backends are not supported in this patch.
* Revert "Fix out-of-order messages by sorting as we display"Drew DeVault2019-09-181-31/+0
| | | | This reverts commit ac99d9ed62644cf0259bdd79481b28c3fbcef650.
* widgets: remove duplicate importWagner Riffel2019-09-121-18/+17
| | | | Signed-off-by: Wagner Riffel <wgrriffel@gmail.com>
* Add signaturesJeffas2019-09-122-2/+66
| | | | | | | | | | | | | 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
* Add modify-labels commandReto Brunner2019-09-121-3/+3
| | | | | This adds the event type as well as the command implementation, but no backend supports it yet.
* Add display of unread messages in dirlistJeffas2019-09-111-1/+98
| | | | | | | Add an onUpdateDirs handler. This is used to invalidate the dirlist and redraw with the correct number of recent/unread/total messages is shown. A config option and formatting options are provided.
* Fix segfault on deleteDevon Johnson2019-09-111-1/+5
|
* Add MouseableJeffas2019-09-118-23/+212
| | | | | | | | | | | | | | | | | | | | | | This adds the Mouseable interface. When this is implemented for a component that item can accept and process mouseevents. At the top level when a mouse event is received it is passed to the grid's handler and then it trickles down until it reaches a component that can actually handle it, such as the tablist, dirlist or msglist. A mouse event is passed so that components can handle other things such as scrolling with the mousewheel. The components themselves then perform the necessary actions. Clicking emails in the messagelist opens them in a new tab. Textinputs can be clicked to position the cursor inside them. Mouseevents are not forwarded to the terminal at the moment. Elements which do not handle mouse events are not required to implement the Mouseable interface.
* widgets: gofmtWagner Riffel2019-09-041-2/+2
| | | | Signed-off-by: Wagner Riffel <wgrriffel@gmail.com>
* widgets: rewrite references to os.SET_SEEK to io.SeekStartWagner Riffel2019-09-041-4/+4
| | | | | | | Os.SET_SEEK is deprecated, it's recommended to use contants from io package Signed-off-by: Wagner Riffel <wgrriffel@gmail.com>
* all: purge redundant underscoresWagner Riffel2019-09-042-3/+3
| | | | Signed-off-by: Wagner Riffel <wgrriffel@gmail.com>
* Use sort.Stable for sorting displayed messagesa3v2019-09-021-1/+1
| | | | | With sort.Sort, sometimes two messages with the same timestamp will switch places every time the message list is redrawn
* Allow custom spinner via config filePaul Spooren2019-08-303-21/+12
| | | | | | | | | | | Allows to set `ui.spinner=` to a string which is then split by `ui.spinner-delimiter=` (Default: comma) instead of having a hard coded animation. This implementation doesn't use INIs capabilities to split strings as it trims whitespaces breaking the default animation. Signed-off-by: Paul Spooren <mail@aparcar.org>
* Fix out-of-order messages by sorting as we displayStephen Brennan2019-08-291-0/+31
| | | | | | | | | | Sometimes I observe out-of-order messages when using a maildir inbox. It appears that the UIDs for these messages are returned out of order by the MessageStore. In order for a maildir MessageStore to return messages in most recently received order, it must have already opened all messages and parsed the date to use as a sort key. Rather than implement that, simply sort messages by time as we display. This fix shows my emails in order.
* Add :prompt commandChristopher Vittal2019-08-262-6/+69
| | | | | | | | | | Usage: :prompt <prompt> <command...> Displays the prompt on the status bar, waits for user input, then appends that input as the last argument to the command and executes it. The input is passed as one argument to the command, unless it is empty, in which case no extra argument is added.
* Only compile regex portion of folder filterDaniel Xu2019-08-201-1/+1
| | | | | | | | | | The code was trying to compile the `~` as well. In this case, it was trying to match a literal `~` to the front of the supplied regex. Fixes: 334ca89bea381 ("folder filter: only assume regex if filter is ~fmt") Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
* folder filter: only assume regex if filter is ~fmtDrew DeVault2019-08-201-4/+9
|
* Add forwarding as attachment featureJelle Besseling2019-08-201-0/+9
| | | | | This allows a single message to be forward as attachment with the :forward -a command
* Add addresses argument to forward commandJelle Besseling2019-08-201-0/+7
|
* Add support for <C-j> as '<Enter>' in ExLineChristopher Vittal2019-08-191-1/+1
|
* Support regex filters for foldersDaniel Xu2019-08-191-1/+11
| | | | | | | | It's nice to be able to filter the folders displayed in the side bar. Basic string matching can get verbose with enough folders whitelisted. Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
* Revert "add close command at global level"Drew DeVault2019-08-131-8/+0
| | | | This reverts commit f0a0c5aa733fa66958c113465bfc5fdd3d7cc9f0.
* add close command at global levelAditya Srivastava2019-08-131-0/+8
|
* Prevent drawing terminal with nil cmdDrew DeVault2019-08-121-1/+1
|
* Ignore scroll command when msgstore is nilJelle Besseling2019-08-121-0/+3
| | | | | | | | | Fixes ~sircmpwn/aerc2#205. Many functions do a nil check on the store, so this changes Store() so it returns nil when msglist is nil. It also places the Scroll() behind the nil check in the next-message command. https://todo.sr.ht/~sircmpwn/aerc2/205
* Close backends prior to shutdownReto Brunner2019-08-081-0/+19
| | | | | | | We need some way to signal the backends that we are about to shutdown, allowing them to clean up (for example in notmuch committing the db changes). This commit implements a hook which gets called upon shutdown, providing backends implement the io.Closer interface.
* Implement next-folder using NextPrev with amountJelle Besseling2019-08-071-3/+3
| | | | | | This fixes ~sircmpwn/aerc2#182 https://todo.sr.ht/~sircmpwn/aerc2/182
* Allow cc/bcc command to receive no argumentsDaniel Bridges2019-08-071-0/+17
|
* cc/bcc: Append to existing headers if called twiceKevin Kuehler2019-08-071-1/+6
| | | | Signed-off-by: Kevin Kuehler <keur@ocf.berkeley.edu>
* Fixing #231 (alternative preferred mimetypes)Ben Cohen2019-08-031-10/+10
|
* Add cc and bcc commandsDaniel Bridges2019-08-031-14/+44
|
* Fix sending attachments with less than 512 bytesBen Burwell2019-08-021-1/+1
|
* Include body MIME terminator in multipart messagesBen Burwell2019-08-021-23/+30
| | | | | | | | Before, the text/plain part of the multipart MIME message was not being correctly terminated with its boundary. The multipart writer writes the terminator when its Close is called, but since the call to Close() was deferred, it was not being called until after the attachments were being written resulting in the boundary not being included at all.
* msglist: add initialization stateReto Brunner2019-08-022-15/+33
| | | | | | | | | Make the msglist aware of whether we are still initializing or not. We never stopped spinning the msglist if we didn't get any Directories back from types.ListDirectories. With this change, we can set the init state from the account and display the spinner only if we don't know whether we have directories or not and else the "no messages" string from the config.
* Ring bell when new messages arrive0.2.0Ben Burwell2019-07-293-0/+20
| | | | | | | | Add a "new-message-bell" option to the UI section of aerc.conf. A new hook into the message store allows the msglist widget to detect new messages being added to the displayed list. When new messages are delivered, and the new-message-bell option is enabled (as it is by default), the terminal will beep.
* Add index option to change-tabJeffas2019-07-271-0/+10
| | | | | | | This allows selection of a tab using its index. It attempts to parse the given argument as a number, if it fails then it uses it as a name. Also supports relative indexes using prefixed + or -.