mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-05-28 17:16:29 +03:00
Reset multi-selection with escape in UITreeViewFS.
This commit is contained in:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user