aboutsummaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2020-01-09compose: don't call ti.tabcomplete when it is nilTimmy Douglas
2020-01-09template: add exec and wrapLeszek Cimała
2020-01-09template: remove last \n to fix additional new lines after quoteLeszek Cimała
2020-01-09add .OriginalMIMEType variable to reply templateLeszek Cimała
2020-01-09create OriginalMail structLeszek Cimała
2020-01-05FetchBodyParts: decode source in the workersReto Brunner
Previously the workers returned a mixture of decoded / encoded parts. This lead to a whole bunch of issues. This commit changes the msgviewer and the commands to assume parts to already be decoded
2020-01-05Don't select completions until tab has been pressedBen Burwell
Before, pressing <Enter> when completions were visible would execute the selected completion. As soon as completions were provided, the first item would be selected. This could cause issues e.g. when changing folders: :cf <Enter> Previously, this would have selected the first folder in the list. Now, since <Tab>, <C-n>, etc have not been pressed to select the first completion, the command above simply executes `:cf `. To accomplish this, a "no-op completion" has been added at index -1.
2020-01-04Fix double >\n when quoting empty lineSrivathsan Murali
2019-12-27Add labels to index format (%g)Reto Brunner
Exposes the notmuch tags accordingly, stubs it for the maildir worker.
2019-12-22fix invalid format stringReto Brunner
2019-12-21msglist: highlight marked messagesReto Brunner
Note that, until we get color configuration, this means that the user *must* have the %Z verb in the index format else it'll be horribly confusing as no visual indication is provided
2019-12-21msgstore: add marking functionalityReto Brunner
2019-12-21Show textinput completions in popoversBen Burwell
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.
2019-12-21Add popoversBen Burwell
A popover is a special UI element which can be layered over the rest of the UI (i.e. it is painted last) and can fall anywhere on the screen, not just with the bounds of its parent's viewport/context. With these special abilities comes the restriction that only one popover may be visible on screen at once. Popovers are requested from the UI context passed to Draw calls and specify the anchor point and the desired dimensions. The popover is then fit to the available space and placed relative to the anchor point.
2019-12-12Break early when delete happens in outdated stateKiril Vladimiroff
A panic could happen when multiple delete messages are sent one after another without waiting until there are no messages left to be deleted: panic: runtime error: makeslice: len out of range goroutine 1 [running]: git.sr.ht/~sircmpwn/aerc/lib.(*MessageStore).Update(0xc000592e00, 0xa8fe60, 0xc0003340f0) /go/src/git.sr.ht/~sircmpwn/aerc/lib/msgstore.go:222 +0x5b8 git.sr.ht/~sircmpwn/aerc/widgets.(*AccountView).onMessage(0xc0000a0460, 0xa8fe60, 0xc0003340f0) /go/src/git.sr.ht/~sircmpwn/aerc/widgets/account.go:251 +0x307 git.sr.ht/~sircmpwn/aerc/widgets.(*AccountView).Tick(0xc0000a0460, 0xc0001496b0) /go/src/git.sr.ht/~sircmpwn/aerc/widgets/account.go:90 +0xa1 git.sr.ht/~sircmpwn/aerc/widgets.(*Aerc).Tick(0xc0000a9f40, 0xc000020501) /go/src/git.sr.ht/~sircmpwn/aerc/widgets/aerc.go:123 +0x91 main.main() /go/src/git.sr.ht/~sircmpwn/aerc/aerc.go:182 +0x5bf The make that blows up is: uids := make([]uint32, len(store.uids)-len(msg.Uids)) This change simply checks whether the make is going to be valid before starting to work on the actual delete. If there are more messages queued to be deleted than what's left in the store, then we're obviously in an inconsistent state, ask for an update and break.
2019-12-07Initialize an empty message map in the message store on initializationRafael Castillo
This addresses occasional crashes when a `MessageInfo` event reached the message store before `DirectoryContents`, particularly on slower (imap) accounts.
2019-11-25Fix crash if there is no to address for %FThorben Günther
2019-11-17Complete the F rune.Srivathsan Murali
%F now shows the auth name or recepient name/address if the message is from you.
2019-11-17Add UI options to save/pipe messages with unsupported mimetypesGreg Anders
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.
2019-11-10Correct capitalization in quoted_replyDrew DeVault
2019-11-10Add some defaults for template optionsDrew DeVault
2019-11-10Add Templates with ParsingSrivathsan Murali
+ 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.
2019-10-14lib/msgstore: fix invalid callback invocationReto Brunner
creating a directory must not invoke the callback, as this is meant for the completion of the move
2019-10-14Fix tab refocus on removeJeffas
Previously removing a tab would always pop from the history of tabs. This checks to see if the closing tab is the one selected, if it is then we use the history, otherwise we only need to change the selected tab if it was after (to the right of) the closing tab, in which case we just decrement the selected index.
2019-10-14Fix pushing invalid tabs to historyJeffas
A tab can now only be pushed onto the history if it is a selectable tab.
2019-10-09Revert "Show spinner when fetching contents"Drew DeVault
This reverts commit 1339faf7881f33762c6e0a4915404e362fc51de1.
2019-10-09Preserve sorting order in search resultsJeffas
This ensures that the search results follow the order of the current sort so that cycling throught the results proceeds in displayed order.
2019-10-09Show spinner when fetching contentsJeffas
The spinner should be shown when fetching the contents as we don't know at that point whether there are some messages or not.
2019-09-29Print success to socket if no error was thrownHeiko Carrasco
When Reto Brunners patch is applied (which works really well for me), the user gets to see the message returned by AercServer. Since this is nil if no errors were thrown it prints "result: <nil>" to the cmd. This patch fixes that by just returning success instead of the error message when err != nil.
2019-09-20Add sorting functionalityJeffas
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.
2019-09-18Focus new tab after removeJeffas
After removing a tab we should focus the newly selected tab if it is Interactive. This ensures things like the terminal get drawn properly.
2019-09-18Revert "Fix out-of-order messages by sorting as we display"Drew DeVault
This reverts commit ac99d9ed62644cf0259bdd79481b28c3fbcef650.
2019-09-12Add modify-labels commandReto Brunner
This adds the event type as well as the command implementation, but no backend supports it yet.
2019-09-11Add display of unread messages in dirlistJeffas
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.
2019-09-11Add MouseableJeffas
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.
2019-09-04widgets: remove redundant key check, delete is no-op if key is emptyWagner Riffel
Signed-off-by: Wagner Riffel <wgrriffel@gmail.com>
2019-08-29extract search criteria parsing into the backendsReto Brunner
2019-08-29Fix out-of-order messages by sorting as we displayStephen Brennan
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.
2019-08-12Add delete forward <C-k> and backward <C-u>Christopher Vittal
Choose the readline defaults for the behavior of these two functions/keybindings. Depending on the program, either of these can delete the whole line. Note that by default in [compose], <C-k> is bound to :prev-field<Enter>. Leave it up to the user whether or not they want to rebind the key in [compose].
2019-08-07Implement next-folder using NextPrev with amountJelle Besseling
This fixes ~sircmpwn/aerc2#182 https://todo.sr.ht/~sircmpwn/aerc2/182
2019-08-03Remove aerc specific code from the uiNicolai Dagestad
Separatiing the ui code from aerc makes it usable as a library in other projects.
2019-07-29Fix test failuresDrew DeVault
2019-07-29Ring bell when new messages arrive0.2.0Ben Burwell
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.
2019-07-29lib/msgstore: Fix Select, Next, Prev with filterKevin Kuehler
When filter is active we want to use store.results instead of store.uids, since we are dealing with a subset of the uids. Otherwise any methods involving len will have undefined behavior. Signed-off-by: Kevin Kuehler <keur@ocf.berkeley.edu>
2019-07-26Fix tabstrip over-drawing when not enough spaceJeffas
Tabstrip didn't take into account the width of the context. Now, it just shows as many tabs as can fit and truncates the last one if necessary. In future it probably would be best to ensure that the selected tab is rendered on the screen.
2019-07-26Add tab completion to textinputsJeffas
This adds tab completion to textinput components. They can be configured with a completion function. This function is called when the user presses <tab>. The first completion is initially shown to the user inserted into the text. Repeated presses of <tab> or <backtab> cycle through the completions list. The completions list is invalidated when any other non-tab-like key is pressed. Also changed is some logic for current completion generation so that all available commands are returned when <tab> is pressed with no current text and similarly for arguments of commands.
2019-07-26Fix invalid tab state when deselecting removed tabDrew DeVault
2019-07-26Add command history and cyclingGalen Abell
Aerc will keep track of the previous 1000 commands, which the user can cycle through using the arrow keys while in the ex-line. Pressing up will move backwards in history while pressing down will move forward.
2019-07-26Move msgstore map to dirstoreJeffas
This map represents a mapping from directory names to their associated messagestores anyway so they should be under dirstore. This simply moves them there and adds some methods required to interact with them.
2019-07-26Add new-email triggerJeffas
This patch sets up the trigger config section of aerc.conf. Each trigger has its own function which is called from the place where it is triggered. Currently only the new-email trigger is implemented. The triggers make use of format strings. For instance, in the new-email trigger this allows the user to select the trigger command and also the information extracted from the command and placed into their command. To actually execute the trigger commands the keypresses are simulated. Further triggers can be implemented in the future. Formatting of the command is moved to a new package.