-
-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add sidebar search #3913
base: main
Are you sure you want to change the base?
add sidebar search #3913
Conversation
c0f9154
to
7a46b60
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done!
I've pushed a few fixes, 7a46b60, so that all the automated tests build and run correctly.
The only significant change was to pass the Sidebar's Window to the callback, rather than its Private Data.
This means we avoid a big dependency problem.
I'll have a closer look through the code in the morning.
I've had a good look at the PR and I see the problem (with the existing code). The code that reads the keyboard is also doing the lookup from, say, d to The rough idea, for the Index, would be:
I'm still investigating how much work it is to fix properly; I'll post my findings when I'm done. |
Years ago, I created some diagrams in the gfx repo. |
#3916 - What I understand about key bindings. struct Keymap *map = STAILQ_FIRST(&Keymaps[mtype]); |
So I've been working on the paging thing I've mentioned earlier in the bug report. It seems I cannot use top_index or bot_index because sb_recalc() rewrites them anyway. I suppose I could do a separate recalc() function just for the overlay. We might need something similar in the future, if we decide to do more this quick/overlay stuff. |
When I refactored the Menu code, I drew a diagram. I listed all the possible start conditions, from an empty list, to overflowing the view at both ends. Next, I listed all the possible actions that could be performed on each of the lists and what I'd like the perfect result to be.
OK
OK. I'm always around on IRC if you want to discuss ideas. |
Meanwhile, I'm still investigating how buf_get_field() and km_dokey_event() interact. km_dokey_event() has a lot of business logic that we don't need. I'll probably end up with a parallel |
a10fa7f
to
c42e0a2
Compare
I've been doing some renaming to the NeoMutt code. The only change that affects you, is that I've renamed |
c42e0a2
to
10e564d
Compare
.. and dlg_change_folder() now index_change_folder() . And yes, I've seen your commits and I do like the changes! |
it didn't make it in the gfx repo, did it ?
Perhaps you would like me to look into this. I know my 1000+ commits on main :) do not qualify. But I feel somehow |
Sorry, I think it may only have been on paper.
Yes, PLEASE ❤️ I'm a programmer, not a manager, so I have a hard time delegating coding :-) Some final thoughts... Each Dialog has set of mappings that are stored in If we can pass multiple The other |
0a2f49b
to
bc2da9e
Compare
Rebased over |
bc2da9e
to
a99be47
Compare
a99be47
to
a2f28cb
Compare
a2f28cb
to
16134e4
Compare
struct EnterWindowData wdata = { buf, 0, es, 0, NULL, NULL, prompt, ENTER_REDRAW_NONE, MUTT_COMP_NO_FLAGS, true, NULL, 0, &mbstate, 0, false, NULL, 0, 0 }; | ||
// clang-format on | ||
|
||
win->wdata = &wdata; |
Check warning
Code scanning / CodeQL
Local variable address stored in non-local memory Warning
source
f6b442a
to
8cc65aa
Compare
6813d3a
to
2e3bb35
Compare
2e3bb35
to
01ca257
Compare
daf191b
to
7076f2f
Compare
7076f2f
to
25f9103
Compare
25f9103
to
1d8e83b
Compare
As title states it will add search option for sidebar mailboxes
Screenshots (if relevant)
add search possibility to sidebar #2397 (comment)
What are the relevant issue numbers?
add search possibility to sidebar #2397
A couple of comments here:
Right of the bat I had to drag sidebar/private.h into enter/window.c. I know this is bad, but being new at this I don't know how to properly lookup sidebar window to pass it to the sb_function_diapatcher(). I've tried several ways to look for it, but with no success, so I dropped the include, passed d->win to the function and called it done.
I had a miserable time adding SidebarDefaultBindings, not because the API wasn't clear or so but because of several
(mtype != MENU_EDITOR) like instances in the code that prevented it from working - we really should get rid of those, I had to put mtype == or mtype != MENU_SIDEBAR in five places, I'm not even sure every instance is required.
search operation is called OP_SIDEBAR_START_SEARCH as in the matcher, I figured out I keep this name because I might later do the search/limit thing that I initially wanted, so keep the namespace open for OP_SIDEBAR_SEARCH OP_SIDEBAR_LIMIT.
I've cheated on the MENU_SIDEBAR ops, I do handle OP_EDITOR_BACKSPACE on MENU_SIDEBAR only to pass it to the enter_function_dispatcher(). The only thing I need there is the callback support for delete buffer operation so I didn't feel like doing editor_backspace code all over again in the sidebar. Perhaps I should put a comment there before anyone thinks that's a typo.