Reset multi-selection with escape in UITreeViewFS.

This commit is contained in:
Martín Lucas Golini
2026-04-17 00:26:29 -03:00
parent 3908920485
commit 9a094f8770

View File

@@ -21,6 +21,7 @@ static const std::map<KeyBindings::Shortcut, std::string> getDefaultKeybindings(
{ { KEY_KP_ENTER }, "open-selected-files" },
{ { KEY_DELETE }, "delete-selected-files" },
{ { KEY_BACKSPACE }, "delete-selected-files" },
{ { KEY_ESCAPE }, "reset-selection" },
};
}
@@ -210,6 +211,11 @@ UITreeViewFS::UITreeViewFS() : UITreeView(), mKeyBindings( getInput() ) {
mCommands["delete-selected-files"] = [this] { deleteSelectedFiles(); };
mCommands["reset-selection"] = [this] {
if ( !getSelection().isEmpty() )
getSelection().set( getSelection().last() );
};
mKeyBindings.addKeybinds( getDefaultKeybindings() );
setSelectionKind( SelectionKind::Multiple );