Add sort hotkeys and fix reverse reset on field switch - #5145
Open
ChelpanovIlya wants to merge 2 commits into
Open
Add sort hotkeys and fix reverse reset on field switch#5145ChelpanovIlya wants to merge 2 commits into
ChelpanovIlya wants to merge 2 commits into
Conversation
Contributor
|
please split this into two commits and force push. |
Contributor
|
Please move the sort_info.reverse related issue to the separate commit or even to the separate PR. |
panel_set_sort_type_by_id() did not reset sort_info.reverse to FALSE when switching to a new sort field. This caused the reverse flag from the previous sort field to carry over to the new one. For example, if the panel was sorted by name in reverse order and the user switched to sort by size, the size sort would also be reversed. This behavior was inconsistent with mouse_sort_col() which already reset reverse to FALSE when clicking a different column header. Fix by setting panel->sort_info.reverse = FALSE when switching to a new sort field, matching the mouse click behavior. Signed-off-by: ChelpanovIlya <ChelpanovIlya@users.noreply.github.com>
ChelpanovIlya
force-pushed
the
pr/sort-hotkeys
branch
2 times, most recently
from
August 28, 2026 17:32
c89d928 to
65fd81c
Compare
Bind sort commands in mc.default.keymap using Alt+Shift+key to avoid conflicts with existing bindings (e.g. Alt+n is HistoryNext): - SortByName = alt-shift-n - SortByExt = alt-shift-x - SortByMTime = alt-shift-m - SortBySize = alt-shift-z Each hotkey toggles ascending/descending when the panel is already sorted by that field. Previously these commands existed but had no default keybindings. Signed-off-by: ChelpanovIlya <ChelpanovIlya@users.noreply.github.com>
ChelpanovIlya
force-pushed
the
pr/sort-hotkeys
branch
from
August 28, 2026 17:36
65fd81c to
5faa8a9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Bind Alt+n/x/m/z to SortByName/SortByExt/SortByMTime/SortBySize in all keymap files. Each hotkey toggles ascending/descending when the panel is already sorted by that field.
Fix panel_set_sort_type_by_id() to reset sort_info.reverse to FALSE when switching to a new sort field, matching the behavior of mouse_sort_col(). Previously the reverse flag was carried over from the previous field.
Checklist
git commit --amend -smake indent && make check)