Skip to content

Commit

Permalink
feat(headers): Do not unselect on Esc
Browse files Browse the repository at this point in the history
  • Loading branch information
phire22 committed Mar 13, 2024
1 parent df4ff00 commit 575bf56
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions wireman/src/events/headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,10 @@ impl EventHandler for HeadersEventHandler {
None => (true, true),
};
let is_meta_tab = ctx.headers.borrow().tab == HeadersTab::Meta;
let none_selected = ctx.headers.borrow().tab == HeadersTab::None;
let mut map = Vec::new();
if none_selected {
map.extend([(KeyEvent::new(KeyCode::Enter), HeadersEvents::NextTab)]);
} else {
map.extend([(KeyEvent::new(KeyCode::Enter), HeadersEvents::Unselect)]);
}
map.extend([(KeyEvent::new(KeyCode::Enter), HeadersEvents::NextTab)]);
if !disabled_root_events {
map.extend([
(KeyEvent::new(KeyCode::Esc), HeadersEvents::Unselect),
(KeyEvent::new(KeyCode::Tab), HeadersEvents::NextTab),
(KeyEvent::shift(KeyCode::BackTab), HeadersEvents::PrevTab),
(KeyEvent::new(KeyCode::Down), HeadersEvents::NextRow),
Expand Down

0 comments on commit 575bf56

Please sign in to comment.