Skip to content

Commit

Permalink
Clear selection when enter is pressed
Browse files Browse the repository at this point in the history
  • Loading branch information
misson20000 committed Sep 25, 2024
1 parent c899bd2 commit 8d9c1f5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/view/listing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,24 @@ impl Interior {
(mode::Mode::Entry, gdk::Key::d , false, false) => self.cursor_entry(facet::cursor::CursorView::enter_hex, 0xd),
(mode::Mode::Entry, gdk::Key::e , false, false) => self.cursor_entry(facet::cursor::CursorView::enter_hex, 0xe),
(mode::Mode::Entry, gdk::Key::f , false, false) => self.cursor_entry(facet::cursor::CursorView::enter_hex, 0xf),

/* clear selection */
(_, gdk::Key::Return, false, false) => {
match self.selection_host.change(selection::listing::Change::Clear) {
Ok(new_selection) => { self.selection_updated(&new_selection); },
Err((error, attempted_version)) => { self.charm_window.upgrade().map(|window| window.report_error(error::Error {
while_attempting: error::Action::RubberBandSelection,
trouble: error::Trouble::ListingSelectionUpdateFailure {
error,
attempted_version,
},
level: error::Level::Warning,
is_bug: true,
})); }
};

glib::Propagation::Proceed
}

_ => glib::Propagation::Proceed,
};
Expand Down

0 comments on commit 8d9c1f5

Please sign in to comment.