panel: make Up/Down cycle through matches during quick search#5068
panel: make Up/Down cycle through matches during quick search#5068karpovilia wants to merge 1 commit intoMidnightCommander:masterfrom
Conversation
72a3d61 to
c6b090f
Compare
|
BTW, in the active quick search mode, pressing of Please remove NEWS file from your PRs. This file is created from the wiki page in the release process. |
egmontkob
left a comment
There was a problem hiding this comment.
When quick search is NOT active, Space marks the current file
and Backspace navigates to the parent directory.
You make multiple unrelated changes. They should preferably go to separate commits.
I truly dislike this particular change, I expect Space to act like a Space (see also freshly filed #5072). We already have two different shortcuts (Insert and Ctrl+T) for toggling the file, we don't need a third one.
Okay, I misunderstood your change, I thought you'd only do this if the command line is empty. You always do it, so I literally cannot type a command line containing a space, nor fix a mistake I made while typing. This is outright unacceptable.
Even if only at empty command line, I'd be against this feature. I want to be able to start a command with a space. And I want to be able to remove a command line by long-pressing Backspace where of course I won't be able to release it at the very exact moment it's erased all the letters.
src/filemanager/panel.c
Outdated
| int res = MSG_HANDLED; | ||
|
|
||
| /* When quick search is active, Up/Down cycle through matches instead of exiting search */ | ||
| if (panel->quick_search.active && (command == CK_Up || command == CK_Down)) |
There was a problem hiding this comment.
I believe a better thing to do would be to add two new symbolic names e.g. CK_Prev/Next_Match or so, and bind them in mc.*.keymap. Maybe some users want to map it to different keys.
Add two new panel actions CK_SearchNext and CK_SearchPrev that cycle through files matching the current quick search pattern, with wrap-around. These are only active while quick search is running. By default, SearchNext is bound to Ctrl+S (same key that starts the search), and SearchPrev has no default binding. Both can be customized in the [Panel] section of the keymap file. This approach follows the existing mc convention of using symbolic action names bound through keymap files, rather than hardcoding keys. Signed-off-by: Ilia Karpov <iakarpov@edu.hse.ru> Signed-off-by: ki <karpovilia@gmail.com>
c6b090f to
b56af9e
Compare
Proposed changes
Add two new panel actions
SearchNextandSearchPrevthat cycle through files matching the current quick search pattern, with wrap-around. These actions are only active while quick search is running.By default,
SearchNextis bound toCtrl+S(same key that starts/continues the search), andSearchPrevhas no default binding. Both can be customized in the[Panel]section of the keymap file.This follows the existing mc convention of using symbolic action names bound through keymap files, rather than hardcoding specific keys.
Checklist
git commit --amend -smake indent && make check)