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:
parent
6536a66ba2
commit
631d8cd20d
1 changed files with 10 additions and 0 deletions
10
src/main.rs
10
src/main.rs
|
|
@ -764,6 +764,16 @@ impl Application for App {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Event::Keyboard(KeyEvent::KeyPressed {
|
||||||
|
key_code: KeyCode::W,
|
||||||
|
modifiers,
|
||||||
|
}) => {
|
||||||
|
if modifiers == Modifiers::CTRL {
|
||||||
|
Some(Message::TabClose(None))
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
}
|
||||||
|
}
|
||||||
Event::Keyboard(KeyEvent::KeyPressed {
|
Event::Keyboard(KeyEvent::KeyPressed {
|
||||||
key_code: KeyCode::V,
|
key_code: KeyCode::V,
|
||||||
modifiers,
|
modifiers,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue