summaryrefslogtreecommitdiff
path: root/widgets/dirlist.go
AgeCommit message (Collapse)Author
2022-04-29dirlist: add format specifier to compact folder nameKoni Marti
Add the format specifier %N to the dirlist-format to display compacted folder names. A folder such as INBOX/WORK/PROJECT will be compacted to I/W/PROJECT in the directoy list. Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
2022-04-27style: add style config options for dirlist_unread and dirlist_recentTim Culverhouse
Adds two style options: dirlist_unread and dirlist_recent. These options apply in layers, in the same way as msglist_* styles do. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
2022-04-14Initialization fix for dynamic foldersAivars Vaivods
There is an issue with backends, that provide dynamic folders, namely when opening folder, that isn't defined in config file, you get empty folder. To actually get messages listed, you need to open that folder twice. At first attempt only DirectoryInfo is fetched and new MessageStore created. Second attempt populates previously created MessageStore with list of messages. For pre-configured folders, DirectoryInfos are fetched upon connection to backend and, when folder is opened, MessageStore is updated with list of messages. Fixes: https://todo.sr.ht/~rjarry/aerc/30 Signed-off-by: Aivars Vaivods <aivars@vaivods.lv> Acked-by: Robin Jarry <robin@jarry.cc>
2022-03-23logging: added a log on panicMoritz Poldrack
Since panics still regularly "destroy" the terminal, it is hard to get a stack trace for panics you do not anticipate. This commit adds a panic handler that automatically creates a logfile inside the current working directory. It has to be added to every goroutine that is started and will repair the terminal on a panic. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
2022-03-03scrollable: extract scrolling behavior for reuseKoni Marti
Extract the vertical scrolling ability into its own Scrollable struct that can be embedded and reused across any ui element that relies on scrolling. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
2022-02-24ui: make dirlist-delay context-awareinwit
Allow this in aerc.conf: dirlist-delay=200ms ... [ui:account=CrappyO365Account] dirlist-delay=2000ms Fixes: https://todo.sr.ht/~rjarry/aerc/26 Signed-off-by: Koni Marti <koni.marti@gmail.com> Signed-off-by: inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
2022-02-23dirtree: implement foldable tree for directory listKoni Marti
implement a foldable tree for the directory list. Expand all parent directories when a hidden directory is selected with the change-folder command. folders-sort considers the top-level directories only. The folders and foldersexclude filters work with the full directory path. Enable tree view by adding 'dirlist-tree=true' to the config file. Implements: https://todo.sr.ht/~sircmpwn/aerc2/228 Signed-off-by: Koni Marti <koni.marti@gmail.com>
2022-01-29dirlist: use shorter delay before listing directory contentsRobin Jarry
1 second is a bit excessive. Use 200ms which should cover most quick folder changes. Add an option to make that delay configurable by the users. References: https://todo.sr.ht/~rjarry/aerc/16 Fixes: cb3090956cfd ("dirlist: skip unnecessary change-folder action") Suggested-by: Koni Marti <koni.marti@gmail.com> Signed-off-by: Robin Jarry <robin@jarry.cc>
2022-01-24dirlist: skip unnecessary change-folder actionKoni Marti
when traversing the directory list, aerc will fetch the contents for every directory even though the user might just move on to the next. This causes an unnecessary delay (and load on the worker) and can be avoided by skipping the old change-folder action when a newer one arrives within a predefined time interval. Signed-off-by: Koni Marti <koni.marti@gmail.com>
2022-01-24dirlist: improve change-folder responsivenessKoni Marti
improves change-folder responsiveness. When changing folders, the highlighted directory is currently updated in a callback function to the open-directory action. This creates an unpleasent lag in the ui until the entire operation is done. Instead, we should provide an immediate visual feedback of the selection to the user and keep loading the directory contents in the background. Signed-off-by: Koni Marti <koni.marti@gmail.com>
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-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-01-12Apply dirlist style to unselected directoriesEyal Sawady
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-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-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-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-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-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-09Add dirlist scrollingJeffas
Should fix #402
2020-05-28Revert "Add Style configuration"Drew DeVault
This reverts commit 0f78f06610c0e8887aba2ae50e99b86477a384b3.
2020-05-27Add Style configurationReto Brunner
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
2020-02-25widgets/dirlist: Fix total message countReto Brunner
This fixes an issue with the updated count logic, where only fetched messages where counted to the exists string of the rue count. Note that the count is still broken (we only count read / unread messages we fetched, but that is the same behaviour as prior to the commit 66b68f35b3f3f3b97ec9951397fd75afeb0d0995)
2020-02-19fix missing importReto Brunner
2020-02-19Revert "Only fetch the directory contents when we are switching directories"Reto Brunner
This reverts commit bd4df530095ee343778a59120a9e641c01010b0f. I did not properly untangle the opening / dirlist update of each other. This interferes with the imap worker, hence the revert
2020-02-16dirlist: actually honor the DirInfoReto Brunner
Currently the dirlist ignores the counts provided by the dirInfo. However some of the workers can actually provide accurate counts much quicker than if we count the flags. Eventually we will also want to enable displaying counts for background folders, where the brute force counting won't work as none of the headers are fetched yet. This commit models it in an opt-in manner, if the flag isn't set then we still count the messages manually.
2020-02-16Only fetch the directory contents when we are switching directoriesReto Brunner
Previously, sending a DirectoryInfo assumed that a directory change happened. However we don't want that if we only want to update the unread message count.
2020-02-07Ensure we aren't selecting negative directoriesAndreas Rammhold
When the list of directories is empty trying to navigate in the directory list did previously lead to a crash. With this change we instead return early before trying to change the directory. Example backtrace: > panic: runtime error: index out of range [-1] > > goroutine 1 [running]: > git.sr.ht/~sircmpwn/aerc/widgets.(*DirectoryList).NextPrev(0xc000160680, 0xffffffffffffffff) > source/aerc/widgets/dirlist.go:285 +0xd4 > git.sr.ht/~sircmpwn/aerc/commands/account.NextPrevFolder.Execute(0xc000191040, 0xc00025c210, 0x1, 0x1, 0x0, 0xc00016f420) > source/aerc/commands/account/next-folder.go:44 +0xe0 > git.sr.ht/~sircmpwn/aerc/commands.(*Commands).ExecuteCommand(0xc0000101a8, 0xc000191040, 0xc00025c210, 0x1, 0x1, 0xc000020070, 0xb46d01) > source/aerc/commands/commands.go:66 +0xa7 > main.execCommand(0xc000191040, 0xc0001ca190, 0xc00025c210, 0x1, 0x1, 0xc00025c210, 0xc0003fb080) > source/aerc/aerc.go:60 +0xc7 > main.main.func3(0xc00025c210, 0x1, 0x1, 0x1, 0x1) > source/aerc/aerc.go:162 +0x57 > git.sr.ht/~sircmpwn/aerc/widgets.(*Aerc).BeginExCommand.func1(0xc000201db0, 0xb) > source/aerc/widgets/aerc.go:382 +0x83 > git.sr.ht/~sircmpwn/aerc/widgets.(*ExLine).Event(0xc0003be100, 0xb475a0, 0xc00023cba0, 0xc00023cba0) > source/aerc/widgets/exline.go:79 +0x131 > git.sr.ht/~sircmpwn/aerc/widgets.(*Aerc).Event(0xc000191040, 0xb475a0, 0xc00023cba0, 0x99ee01) > source/aerc/widgets/aerc.go:202 +0x4c1 > git.sr.ht/~sircmpwn/aerc/widgets.(*Aerc).simulate(0xc000191040, 0xc000036f00, 0xd, 0x10) > source/aerc/widgets/aerc.go:195 +0x8d > git.sr.ht/~sircmpwn/aerc/widgets.(*Aerc).Event(0xc000191040, 0xb475a0, 0xc00023c9c0, 0x9c5a60) > source/aerc/widgets/aerc.go:218 +0x3e8 > git.sr.ht/~sircmpwn/aerc/lib/ui.(*UI).Tick(0xc0001ca190, 0xa99d00) > source/aerc/lib/ui/ui.go:92 +0x190 > main.main() > source/aerc/aerc.go:192 +0x5f2
2020-01-28dirlist: adapt to dynamic UIconfigReto Brunner
2020-01-28dirlist: remove not needed sort functionReto Brunner
The docs of strings.Compare state: > Compare is included only for symmetry with package bytes. It is usually > clearer and always faster to use the built-in string comparison operators > ==, <, >, and so on. So let's do that.
2019-12-09Add custom sorting for foldersMichele Finotto
A new config options for accounts.conf (folders-sort) was added to allow a user to choose which folders should be shown on top. My use case was to avoid stepping into heavy, but rarely viewed folders when cycling through other often accessed ones. To test add this to your account.conf: folders-sort = INBOX,Sent,Archive INBOX, Sent and Archive should then show at the top of your dirlist, and all other folders should come next in alphabetical order.
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-08-30Allow custom spinner via config filePaul Spooren
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>
2019-08-20Only compile regex portion of folder filterDaniel Xu
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>
2019-08-20folder filter: only assume regex if filter is ~fmtDrew DeVault
2019-08-19Support regex filters for foldersDaniel Xu
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>
2019-08-07Implement next-folder using NextPrev with amountJelle Besseling
This fixes ~sircmpwn/aerc2#182 https://todo.sr.ht/~sircmpwn/aerc2/182
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-25Show the directory being selected in grayJeffas
2019-07-08Factor UI models out of the worker message packageBen Burwell
Before, the information needed to display different parts of the UI was tightly coupled to the specific messages being sent back and forth to the backend worker. Separating out a models package allows us to be more specific about exactly what a backend is able to and required to provide for the UI.
2019-07-04Sort out dirstore once and for allDrew DeVault
2019-07-04dirlist: simplify nextPrev() considerablyReto Brunner
Assuming we always have a sorted dirlist (other code depends on that already), we don't need to loop over the dirStore. Any filtering done should be performed elsewhere
2019-07-04dirlist: remove the additional filtering in Draw()Reto Brunner
2019-07-04dirlist: sync dirstore in filterDirsByFoldersConfigReto Brunner
Also sets the public List() method to return the unfiltered list of directories directly from the store.
2019-07-04Add IMAP folder tab completionGregory Mullen
Credit for this fix goes to Reto; I guess if we're not gonna be mutt we should probabaly do things correctly.
2019-07-02Revert "Remove dirs field and references to it"Drew DeVault
This reverts commit 0e55637aac92e748267559b7aa91a188a17c386f.
2019-06-30Remove dirs field and references to itRobert Günzler
This fixes prev/next-folder that broke after 546dfcd76dd228e0605359e9985f0b6a5672e8fa
2019-06-29Add new lib/dirstore to source completions fromGregory Mullen