summaryrefslogtreecommitdiff
path: root/widgets
AgeCommit message (Collapse)Author
2021-12-11binds: add account specific bindingsJonathan Bartlett
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>
2021-11-30style: customize vertical and horizontal border charactersDian M Fay
New border-char-horizontal and border-char-vertical config settings in aerc.conf allow users to modify border appearance from the default 1-wide/tall blank space. In stylesets, border.fg now affects the foreground color when custom characters are defined. Signed-off-by: Robin Jarry <robin@jarry.cc>
2021-11-13notmuch: allow sort by file orderKalyan Sriram
When using the notmuch backend, it often makes more sense to sort folders (actual virtual folders, or queries) by the order specified in the query-map file, rather than alphabetically. This patch introduces a configuration option (disabled by default) that allows this. Additionally, due to the notmuch backend previously using maps (which are order-undefined) to store the list of queries, default query selection on aerc startup fluctuated. This patch fixes that by using slices to store query order.
2021-11-13messages: allow displaying email threadsy0ast
Display threads in the message list. For now, only supported by the notmuch backend and on IMAP when the server supports the THREAD extension. Setting threading-enable=true is global and will cause the message list to be empty with maildir:// accounts. Co-authored-by: Kevin Kuehler <keur@xcf.berkeley.edu> Co-authored-by: Reto Brunner <reto@labrat.space> Signed-off-by: Robin Jarry <robin@jarry.cc>
2021-11-06index: add this-week-time-formatRobin Jarry
Also allow specific time format for messages received within the last 7 days. Signed-off-by: Robin Jarry <robin@jarry.cc>
2021-11-05imap: add manual {dis,}connect supportRobin Jarry
Signed-off-by: Robin Jarry <robin@jarry.cc>
2021-11-05viewer: add colon after header namesRobin Jarry
Display them as standard RFC 822 headers. Signed-off-by: Robin Jarry <robin@jarry.cc>
2021-11-05go.mod: change base git urlRobin Jarry
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>
2021-10-28view,compose: use border color to separate headers from bodyRobin Jarry
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>
2021-10-28index: allow dynamic formatting of message datesRobin Jarry
When a message has been sent today (or this year) allow formatting the date differently. For example, with: [ui] index-format=%-25.25n %-25.25D %s timestamp-format=2006 Jan 02, 15:04 GMT-0700 this-day-time-format=Today at 15:04 this-year-time-format=Jan 02 The message list would look like this (spaces collapsed): Robin Jarry Today at 16:30 [PATCH 1/2] bindings: prepare for more modifers bugzilla@dpdk.org Oct 26 [dpdk-dev] [Bug 839] pdump: any subsequent runs of pdump_autotest fail Holger Levsen 2020 Mar 15, 13:44 GMT+01 +1 (Re: FTP Team -- call for volunteers) Signed-off-by: Robin Jarry <robin@jarry.cc>
2021-10-28filters: allow matching any email headerRobin Jarry
In addition of the common headers (subject, to, from, cc), allow matching arbitrary email headers in filters. E.g.: x-bugzilla-severity,critical=tput setaf 1; cat;tput sgr0 Signed-off-by: Robin Jarry <robin@jarry.cc>
2021-10-28bindings: prepare for more modifersRobin Jarry
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>
2021-04-13widgets/terminal: Only call vterm.ScreenCell.Attrs once in styleFromCellClayton Craft
This fixes a substantial performance issue when scrolling emails with long/complicated contents, where scrolling down a single line can take something like hundreds of ms before the screen is updated to reflect the scroll. It's really bad if the email has lots of columns, e.g. like if it's an html email that was passed through a filter (w3m, etc) to render it. Using pprof, I found that the multiple calls to vterm.ScreenCell.Attrs() in styleFromCell were really really expensive. This patch replaces them with a single call. Here's a before and after with a simple, but very manual test of opening a large email with contents that went through a w3m filter and continuously scrolling up and down over and over for ~30 seconds: *** Before: ----------------------------------------------------------+------------- flat flat% sum% cum cum% calls calls% + context ----------------------------------------------------------+------------- 28.25s 100% | git.x2esr.x2eht..z2f..z7esircmpwn..z2faerc..z2fwidgets.PartSwitcher.Draw 0 0% 99.94% 28.25s 82.31% | git.x2esr.x2eht..z2f..z7esircmpwn..z2faerc..z2fwidgets.PartViewer.Draw 28.25s 100% | git.x2esr.x2eht..z2f..z7esircmpwn..z2faerc..z2fwidgets.Terminal.Draw ----------------------------------------------------------+------------- 28.25s 100% | git.x2esr.x2eht..z2f..z7esircmpwn..z2faerc..z2fwidgets.PartViewer.Draw 0 0% 99.94% 28.25s 82.31% | git.x2esr.x2eht..z2f..z7esircmpwn..z2faerc..z2fwidgets.Terminal.Draw 19.23s 68.07% | git.x2esr.x2eht..z2f..z7esircmpwn..z2faerc..z2fwidgets.Terminal.styleFromCell 6.04s 21.38% | github.x2ecom..z2fddevault..z2fgo..z2dlibvterm.Screen.GetCellAt 1.38s 4.88% | git.x2esr.x2eht..z2f..z7esircmpwn..z2faerc..z2flib..z2fui.Context.Printf 0.62s 2.19% | runtime.mapassign 0.43s 1.52% | runtime.mapaccess2 0.20s 0.71% | runtime.newobject 0.19s 0.67% | runtime.callers (inline) 0.07s 0.25% | runtime.makeslice 0.07s 0.25% | runtime.mallocgc ----------------------------------------------------------+------------- 19.23s 100% | git.x2esr.x2eht..z2f..z7esircmpwn..z2faerc..z2fwidgets.Terminal.Draw 0 0% 99.94% 19.23s 56.03% | git.x2esr.x2eht..z2f..z7esircmpwn..z2faerc..z2fwidgets.Terminal.styleFromCell 19.21s 99.90% | github.x2ecom..z2fddevault..z2fgo..z2dlibvterm.ScreenCell.Attrs *** After: ----------------------------------------------------------+------------- flat flat% sum% cum cum% calls calls% + context ----------------------------------------------------------+------------- 0.31s 100% | git.x2esr.x2eht/~sircmpwn/aerc/widgets.Terminal.Draw 0 0% 99.87% 0.31s 1.33% | github.x2ecom/ddevault/go-libvterm.NewPos 0.25s 80.65% | runtime.callers (inline) 0.04s 12.90% | runtime.gomcache (inline) ----------------------------------------------------------+------------- 8.40s 100% | github.x2ecom/ddevault/go-libvterm.Screen.GetCellAt 0 0% 99.87% 8.40s 36.11% | github.x2ecom/ddevault/go-libvterm.Screen.GetCell 7.14s 85.00% | github.x2ecom/ddevault/go-libvterm._cgoCheckPointer 0.54s 6.43% | runtime.callers (inline) 0.35s 4.17% | runtime.exitsyscall 0.11s 1.31% | runtime.deferprocStack 0.07s 0.83% | doentersyscall 0.07s 0.83% | runtime.getg 0.05s 0.6% | runtime.casgstatus 0.03s 0.36% | _init 0.03s 0.36% | runtime.gomcache (inline) ----------------------------------------------------------+------------- 8.46s 100% | git.x2esr.x2eht/~sircmpwn/aerc/widgets.Terminal.Draw 0 0% 99.87% 8.46s 36.37% | github.x2ecom/ddevault/go-libvterm.Screen.GetCellAt 8.40s 99.29% | github.x2ecom/ddevault/go-libvterm.Screen.GetCell 0.06s 0.71% | runtime.callers (inline) ----------------------------------------------------------+------------- 0.31s 100% | git.x2esr.x2eht/~sircmpwn/aerc/widgets.Terminal.styleFromCell 0 0% 99.87% 0.31s 1.33% | github.x2ecom/ddevault/go-libvterm.ScreenCell.Attrs )
2021-02-07terminal: Add support for Shift+TabAlexey Yerin
2021-01-30Get rid of the aerc.PushError(" " + $string) idiomReto Brunner
The individual callers should not be responsible for padding
2021-01-14compose: apply default style to header separatorEyal Sawady
2021-01-12trim <> from messageIDs when handling mailto linksReto Brunner
Co-authored-by: James Walmsley <james@fullfat-fs.co.uk>
2021-01-12Apply dirlist style to unselected directoriesEyal Sawady
2021-01-03Reapply 'Fix nil pointer deref on Envelope'Shaw Vrana
The commit bf16ccde484ce3b6d2a4b843e7ebc04a9b2a957d appears to have been unintentionally dropped by commit 905cb9dfd3ef197bb4b59039a1be76ce2c8e3099 (Implement style configuration).
2020-12-24add italics supporty0ast
Fixes: https://todo.sr.ht/~sircmpwn/aerc2/416 Co-authored-by: JD <john1doe@ya.ru>
2020-12-18update tcell to v2 and enable TrueColor supporty0ast
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.
2020-12-15Use extensions for querying the mime type of attachmentsReto Brunner
This gets rid of the issue that lots of things are detected as zip files, even though they are a more specialized format (say office files)
2020-11-28fix mailto parsingReto Brunner
2020-11-14compose: use a proper header instead of a string mapReto Brunner
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.
2020-11-14rename header to heditorsReto Brunner
2020-11-01Apply relevant msglist styles in orderChris Vittal
Allow styles to be layered over a base style. The list of styles to apply is layered over the base style in order, such that if the layer does not differ from the base it is not used. The order that these styles are applied in is, from first to last: msglist_default msglist_unread msglist_read (exclusive with unread, so technically the same level) msglist_flagged msglist_deleted msglist_marked So, msglist_marked style dominates. This fixes an issue where the msglist_deleted style was not being applied.
2020-10-14refactor ParseMessageFormat to use a ctx objectReto Brunner
2020-09-08dirlist: fix empty row if dir is addedReto Brunner
There is a window where a new dir entry isn't yet in the dirlist.dir. dirlist.ensureScroll however expected to always find a valid index. Add a check so that we don't try to scroll to a -1 index.
2020-09-07Make mimetype check consistent across casesy0ast
2020-09-01correctly apply msglist_read colory0ast
2020-08-20base models.Address on the mail.Address typeReto Brunner
This allows us to hook into the std libs implementation of parsing related stuff. For this, we need to get rid of the distinction between a mailbox and a host to just a single "address" field. However this is already the common case. All but one users immediately concatenated the mbox/domain to a single address. So this in effects makes it simpler for most cases and we simply do the transformation in the special case.
2020-08-19Add support for :rmdirARaspiK
The `:rmdir` command removes the current directory (`-f` is required if the directory is not empty). This is not supported on the notmuch backend. An issue with the maildir backend is that some sync programs (e.g. offlineimap) may recover the directory after it is deleted. They need to specifically be configured to accept deletions, or special commands need to be executed (e.g. `offlineimap --delete-folder`) to properly delete folders. A danger of using this on the IMAP backend is that it is possible for a new message to be added to the directory and for aerc to not show it immediately (due to a slow connection) - using `:rmdir` at this moment (with `-f` if the directory already contains messages) would delete the directory and the new message that just arrived (and all other contents). This is documented in aerc(1) so that users are aware of possible risks.
2020-08-10show error if account view creation failsReto Brunner
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.
2020-08-06Rename selecter to selectorKalyan Sriram
2020-08-06Implement style configuration.Kalyan Sriram
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.
2020-07-30Revert "Implement style configuration."Reto Brunner
This reverts commit 1ff687ca2b0821c2cacc1fa725abb3302d2af9da.
2020-07-30Revert "Rename selecter to selector"Reto Brunner
This reverts commit 2c244222d508a32d3f5ba600944a46b6fdea1a10.
2020-07-30Rename selecter to selectorKalyan Sriram
2020-07-30Implement style configuration.Kalyan Sriram
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.
2020-07-30msgviewer: set max line length to 1 GBReto Brunner
some people send around huge html without any newline in between. This did overflow the default 64KB buffer of bufio.Scanner. If something can't fit in a GB there's no hope left Also, ignoring errors is bad mkey
2020-07-30msgviewer: simplify attemptCopyReto Brunner
No functional changes, simply extract more complex stuff into sub functions to help readability.
2020-07-27Remove hard coded bodystruct path everywhereReto Brunner
Aerc usually used the path []int{1} if it didn't know what the proper path is. However this only works for multipart messages and breaks if it isn't one. This patch removes all the hard coding and extracts the necessary helpers to lib.
2020-07-09Use PushStatus instead of SetStatus where it makes senseHeiko Carrasco
2020-07-05status: invalidate when neededReto Brunner
In order for the message to actually show up we need to invalidate after setting the status stack.
2020-07-02Add a 'folders-exclude' optionARaspiK
Added a 'folders-exclude' option that allows removing selected folders from the directory list sidebar. My motivating example was that removing a single folder from the list using Golang regexes seemed pretty hard, so this is a better way to do it. The excluded folders list is included in the man page.
2020-07-02Fix nil pointer deref on EnvelopeAndrew Jeffery
The Envelope was nil but being deref'ed for the Subject. This was experienced when switching tabs on IMAP.
2020-06-09Add scrollbarJeffas
This transplants the logic for drawing the scrollbar from dirlist and the completion popover and adds it to the msglist.
2020-06-09Rework msglist scrollingJeffas
This changes the scrolling to be done on the draw, when the height is updated, ensuring that the selected item is kept on screen during resizing. Also, this ensures that messages will fill the screen when resizing the window, for instance, shrinking and then growing drags down more messages if possible. This is a transplant of the dirlist scrolling logic.
2020-06-09Add dirlist scrollbarJeffas
This mimics the scrollbar implementation from the completion popover. Only showing it when necessary and adapting the dirlist strings appropriately.
2020-06-09Make grid sizes dynamicJeffas
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.