fixed up writing to/deleting (but overflows still happen it seems)
This commit is contained in:
parent
b749733fb7
commit
7434a2b94d
|
@ -195,6 +195,16 @@ impl SigninPage {
|
|||
]
|
||||
.into()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn char(&mut self, c: char) {
|
||||
match self.cursor {
|
||||
SigninCursorLocation::Hostname => {
|
||||
self.hostname.push(c);
|
||||
}
|
||||
SigninCursorLocation::Ok => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Page for SigninPage {
|
||||
|
@ -206,10 +216,16 @@ impl Page for SigninPage {
|
|||
) -> Result<()> {
|
||||
match event {
|
||||
Event::Key(key) => match key {
|
||||
termion::event::Key::Char(_) => {}
|
||||
termion::event::Key::Char(c) => self.char(c),
|
||||
termion::event::Key::Up => self.next(),
|
||||
termion::event::Key::Down => self.previous(),
|
||||
termion::event::Key::Backspace => {}
|
||||
termion::event::Key::Backspace => {
|
||||
if let SigninCursorLocation::Hostname =
|
||||
self.cursor
|
||||
{
|
||||
self.hostname.pop();
|
||||
}
|
||||
}
|
||||
termion::event::Key::Delete => {}
|
||||
termion::event::Key::Left => {}
|
||||
termion::event::Key::Right => {}
|
||||
|
|
Loading…
Reference in New Issue