| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Another attempt at fixing the high CPU usage when terminal tabs are
running interactive tui applications and the message list tab is
selected.
There are cases where a terminal widget can be visible but not focused
(composer, message viewer, attachment selector, etc.). Define a new
Visible interface with a single Show() method. Call that method when
changing tabs to make sure that terminal widget content events only
trigger redraws when they are visible.
Fixes: 382aea4a9426 ("terminal: avoid high cpu usage when not focused")
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Koni Marti <koni.marti@gmail.com>
|
|
|
|
|
|
|
|
| |
Rework how tabs are closed. Change the aerc.RemoveTab and
aerc.ReplaceTab functions to accept a new boolean argument. If true,
make sure to close the tab content.
Signed-off-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
| |
Use a go template to render the account tab display. Add config option
for setting a specific template for the account. Add a method on Tab to
allow setting a title, which may be different than the tab Name.
The default template is {{.Account}}.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
| |
Remove invalidatable type and all associated calls. All items can
directly invalidate the UI.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
Signed-off-by: Moritz Poldrack <moritz@poldrack.dev>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
| |
Run `make fmt`.
Signed-off-by: Moritz Poldrack <git@moritz.sh>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
| |
Protect the access to the tabs array and current index with a mutex.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Koni Marti <koni.marti@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Tabs object exposes an array of Tab objects and the current selected
index in that array. The these two fields are sometimes modified in
goroutines, which can lead to data races causing fatal out of bounds
accesses on the tab array.
Hide these fields as private API. Expose only what needs to be seen from
the outside. This will prepare for protecting concurrent access with
a lock in the next commit.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Koni Marti <koni.marti@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit d7feb56cbe7b81160b580ec2f5dcaef78c7a2230.
This commit introduced a regression in which upon closing any but the
last tab caused an out of range panic would occur.
Steps to reproduce
- open a tab
- open another tab
- close the first tab
Fixes: https://todo.sr.ht/~rjarry/aerc/58
Reported-by: akspecs <akspecs@gmail.com>
Signed-off-by: Moritz Poldrack <git@moritz.sh>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
| |
This change fixes a panic caused by the selected tab being out of sync
when selecting a new one in widgets.(*Aerc).SelectedTab(). This happens
if the tab is already removed from the list of tabs, but the selection
not yet being updated.
This was achieved by moving the tabs behind updating the selection.
Signed-off-by: Moritz Poldrack <git@moritz.sh>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
|
|
|
|
|
|
|
|
|
| |
Use contextual ui styleset for tabs and compose widgets. If no account
is selected, use default styleset as fallback.
Fixes: https://todo.sr.ht/~rjarry/aerc/3
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
This reverts commit 1ff687ca2b0821c2cacc1fa725abb3302d2af9da.
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
This reverts commit 0f78f06610c0e8887aba2ae50e99b86477a384b3.
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Closes https://todo.sr.ht/~sircmpwn/aerc2/379
The old `MessageView` was not closed when replacing the tab content, which
causes a memory leak.
|
|
|
|
|
|
| |
This adds the commands pin-tab and unpin-tab. Once pinned a tab lives on
the left of the tabstrip and has a configurable marker, defaulting to `
before its name.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
A tab can now only be pushed onto the history if it is a selectable tab.
|
|
|
|
|
| |
After removing a tab we should focus the newly selected tab if it is
Interactive. This ensures things like the terminal get drawn properly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
Executing :close on a terminal would panic due to it already having been
removed.
This is also related to the fact that removing a tab doesn't check for
whether it actually found a tab to remove or not.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This command allows the user to change tab by giving the tab name. This
can be tab completed too. The previous tab is stored in the tabs module
so that when a new tab is created it is still possible to go to the
previous one.
Normal invocation is :ct folder
Previous tab is :ct -
|
|
|
|
|
|
|
|
|
|
|
| |
This introduces a new interface `Clickable`. I'd imagine this would be
implemented for most widgets eventually and would allow for programs run
in the terminal to also have their mouse events forwarded to them.
For the tabs it was relatively simple to check that the position of the
click is within the boxes for the tabs. For other components I'd imagine
that some state representing their currently drawn bounding box would be
useful.
|
|
|
|
|
|
| |
Also expose a light wrapper method in aerc.go for tab replacement
Signed-off-by: Kevin Kuehler <kkuehler@brave.com>
|
| |
|
|
|
|
| |
Fixes #77: When closing a tab, bring you back to the one you last had focused
|
|
|
|
| |
Also moves truncation to the tab widget
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Fix a few potential out of bounds by placing proper checks, which should
be relevant if all tabs are removed for some reason.
Also avoid iterating all tabs in the invalidate handler, since we are
only interested in whether it's the selected tab either way
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a simple mostly straight forward switch to tcell in favor of
termbox.
It uses the tcell native api (not the compat layer) but does not make
use of most features.
Further changes should include moving to tcell's views.TextArea and the
general built in widget behaviour instead of the current ad hoc
implementation.
Regression: Cursor isn't shown in ex-line
|
|
|