SetupActivity: <CTRL+E> as <DEL>

This commit is contained in:
ChristianVisintin 2020-12-25 19:38:17 +01:00
parent 16a011e81e
commit 46ee01e073
2 changed files with 19 additions and 0 deletions

View file

@ -120,6 +120,15 @@ impl SetupActivity {
if key.modifiers.intersects(KeyModifiers::CONTROL) {
// Match char
match ch {
'e' | 'E' => {
// Prompt to delete selected key
self.yesno_opt = YesNoDialogOption::No; // Default to no
self.popup = Some(Popup::YesNo(
String::from("Delete key?"),
Self::callback_delete_ssh_key,
Self::callback_nothing_to_do,
));
}
'h' | 'H' => {
// Show help
self.popup = Some(Popup::Help);

View file

@ -544,6 +544,16 @@ impl SetupActivity {
Span::raw(" "),
Span::raw("Delete entry"),
])),
ListItem::new(Spans::from(vec![
Span::styled(
"<CTRL+E>",
Style::default()
.fg(Color::Cyan)
.add_modifier(Modifier::BOLD),
),
Span::raw(" "),
Span::raw("Delete entry"),
])),
ListItem::new(Spans::from(vec![
Span::styled(
"<CTRL+H>",