From b2445658342c0787c405cfc06fe081ece1494af9 Mon Sep 17 00:00:00 2001 From: ChelpanovIlya Date: Fri, 28 Aug 2026 20:30:22 +0300 Subject: [PATCH 1/2] Fix sort reverse flag not reset when switching sort fields 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 --- src/filemanager/panel.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/filemanager/panel.c b/src/filemanager/panel.c index d46a4dafb..ccf4d8a08 100644 --- a/src/filemanager/panel.c +++ b/src/filemanager/panel.c @@ -3297,6 +3297,7 @@ panel_set_sort_type_by_id (WPanel *panel, const char *name) return; panel->sort_field = sort_order; + panel->sort_info.reverse = FALSE; } panel_set_sort_order (panel, panel->sort_field); From 5faa8a98aa991c2ff319fc42350b57ff130acaa0 Mon Sep 17 00:00:00 2001 From: ChelpanovIlya Date: Fri, 28 Aug 2026 20:35:51 +0300 Subject: [PATCH 2/2] Add default keybindings for sort-by commands 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 --- misc/mc.default.keymap | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/misc/mc.default.keymap b/misc/mc.default.keymap index 7e107805e..09bbd6ac5 100644 --- a/misc/mc.default.keymap +++ b/misc/mc.default.keymap @@ -122,11 +122,10 @@ Bottom = alt-gt; end; c1 # SortPrev = # SortNext = # SortReverse = -# SortByName = -# SortByVersion = -# SortByExt = -# SortBySize = -# SortByMTime = +SortByName = alt-shift-n +SortByExt = alt-shift-x +SortByMTime = alt-shift-m +SortBySize = alt-shift-z # Filter = ScrollLeft = alt-lparenthesis ScrollRight = alt-rparenthesis