Add shortcut to close the current tab

Defaults to `ctrl-w`.

Source: https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts#Tab_management
This commit is contained in:
Josh Megnauth 2024-01-16 04:36:27 -05:00 committed by Jeremy Soller
parent 6536a66ba2
commit 631d8cd20d

View file

@ -764,6 +764,16 @@ impl Application for App {
None
}
}
Event::Keyboard(KeyEvent::KeyPressed {
key_code: KeyCode::W,
modifiers,
}) => {
if modifiers == Modifiers::CTRL {
Some(Message::TabClose(None))
} else {
None
}
}
Event::Keyboard(KeyEvent::KeyPressed {
key_code: KeyCode::V,
modifiers,