aerc/lib
Koni Marti 588be1a284 store: improve cursor position
Improve cursor re-positioning while filtering with and without threads.
Reposition cursor in client-side threading mode with a callback that is
set during store.NextPrev(). Run callback when the threads are
constructed in order to reposition the cursor correctly. The callback is
deactivated when store.Select() is called.

Steps to reproduce two issues:

* Reproduce issue 1:

1. Activate client-side threading
2. Apply a filter, e.g. :filter -f Koni
3. Move cursor around so that a message is highlighted
4. clear filter with :clear
5. The cursor is expected to remain on the selected message but is
   actually not

* Reproduce issue 2:

1. Activate client-side threading
2. Go the end of the message list
2. Apply a filter, e.g. :filter -f Koni
5. The cursor is now at the end of the filtered results instead of at
   the beginning

This patch fixes both of those issues. Tested in regular and threaded
view according to the following check list (expected behavior in
parenthesis):

1. Apply filter from a message that remains in the filter (cursor on message,
   message selected)
2. Apply filter from a message that will not remain (cursor at the top,
   no message selected)
3. Clear filter (cursor remains on message, message selected)
4. Scroll line-by-line (threads: cursor remains on line, does not "jump"
   with message)
5. Search (cursor on first result)

Signed-off-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Tim Culverhouse <tim@timculverhouse.com>
2022-08-22 10:01:46 +02:00
..
auth lint: homogenize operations and minor fixes (gocritic) 2022-08-04 21:58:01 +02:00
calendar lint: ensure errors are at least logged (errcheck) 2022-08-04 21:57:57 +02:00
crypto go: removed io/ioutil 2022-08-22 09:30:19 +02:00
format lint: homogenize operations and minor fixes (gocritic) 2022-08-04 21:58:01 +02:00
marker mark: allow multiple visual selections 2022-08-22 09:30:37 +02:00
parse go: removed io/ioutil 2022-08-22 09:30:19 +02:00
sort go.mod: change base git url 2021-11-05 10:21:45 +01:00
statusline lint: homogenize operations and minor fixes (gocritic) 2022-08-04 21:58:01 +02:00
templates lint: apply new formatting rules 2022-08-01 10:44:52 +02:00
ui lint: homogenize operations and minor fixes (gocritic) 2022-08-04 21:58:01 +02:00
uidstore Create UIDStore package 2019-07-12 11:09:47 -04:00
attachment.go compose: refactor attachment handling 2022-07-02 17:52:49 +02:00
dirstore.go Move msgstore map to dirstore 2019-07-26 14:15:27 -04:00
history.go Add command history and cycling 2019-07-26 14:29:34 -04:00
keepalive_dummy.go format: reformat code with go 1.17 2021-12-11 23:24:08 +01:00
keepalive_linux.go format: reformat code with go 1.17 2021-12-11 23:24:08 +01:00
messageview.go go: removed io/ioutil 2022-08-22 09:30:19 +02:00
msgstore.go store: improve cursor position 2022-08-22 10:01:46 +02:00
oauthbearer.go lint: work nicely with wrapped errors (errorlint) 2022-08-04 21:58:04 +02:00
open.go lint: homogenize operations and minor fixes (gocritic) 2022-08-04 21:58:01 +02:00
socket.go lint: ensure errors are at least logged (errcheck) 2022-08-04 21:57:57 +02:00
structure_helpers.go lint: homogenize operations and minor fixes (gocritic) 2022-08-04 21:58:01 +02:00
structure_helpers_test.go lint: apply new formatting rules 2022-08-01 10:44:52 +02:00
threadbuilder.go lint: ensure errors are at least logged (errcheck) 2022-08-04 21:57:57 +02:00