mirror of
https://github.com/veeso/termscp.git
synced 2025-12-07 09:36:00 -08:00
Wrap selected element in auth_activity when at the end of the list; move also with <TAB>
This commit is contained in:
@@ -190,21 +190,21 @@ impl AuthActivity {
|
|||||||
KeyCode::Up => {
|
KeyCode::Up => {
|
||||||
// Move item up
|
// Move item up
|
||||||
self.selected_field = match self.selected_field {
|
self.selected_field = match self.selected_field {
|
||||||
InputField::Address => InputField::Address, // End of list
|
InputField::Address => InputField::Password, // End of list (wrap)
|
||||||
InputField::Port => InputField::Address,
|
InputField::Port => InputField::Address,
|
||||||
InputField::Protocol => InputField::Port,
|
InputField::Protocol => InputField::Port,
|
||||||
InputField::Username => InputField::Protocol,
|
InputField::Username => InputField::Protocol,
|
||||||
InputField::Password => InputField::Username,
|
InputField::Password => InputField::Username,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
KeyCode::Down => {
|
KeyCode::Down | KeyCode::Tab => {
|
||||||
// Move item down
|
// Move item down
|
||||||
self.selected_field = match self.selected_field {
|
self.selected_field = match self.selected_field {
|
||||||
InputField::Address => InputField::Port,
|
InputField::Address => InputField::Port,
|
||||||
InputField::Port => InputField::Protocol,
|
InputField::Port => InputField::Protocol,
|
||||||
InputField::Protocol => InputField::Username,
|
InputField::Protocol => InputField::Username,
|
||||||
InputField::Username => InputField::Password,
|
InputField::Username => InputField::Password,
|
||||||
InputField::Password => InputField::Password, // End of list
|
InputField::Password => InputField::Address, // End of list (wrap)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
KeyCode::Char(ch) => {
|
KeyCode::Char(ch) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user