ui: add two readline shortcuts in text fields

pull/234/head
Manos Pitsidianakis 5 years ago
parent 1a02491f04
commit 565b11634a
No known key found for this signature in database
GPG Key ID: 73627C2F690DF710

@ -187,6 +187,17 @@ impl Component for Field {
}
}
}
UIEvent::InsertInput(Key::Ctrl('a')) => {
if let Text(ref mut s, _) = self {
s.set_cursor(0);
}
}
UIEvent::InsertInput(Key::Ctrl('e')) => {
if let Text(ref mut s, _) = self {
s.set_cursor(s.as_str().len());
}
}
/* TODO: add rest of readline shortcuts */
_ => {
return false;
}

Loading…
Cancel
Save