diff options
author | Klara Modin <klarasmodin@gmail.com> | 2022-06-20 19:54:53 +0200 |
---|---|---|
committer | Klara Modin <klarasmodin@gmail.com> | 2022-06-20 19:54:53 +0200 |
commit | 9b0d10dc4ad544b406a2258bdb7f9c3aef13c33e (patch) | |
tree | ea71267bb85d4f4989355c57e574096ff8f2c898 | |
parent | c45f04fa28541836fefc3c6cac32d107d642e7c5 (diff) |
fix some build issues
get_wch() seems to be causing an issue so use getch() instead
-rw-r--r-- | src/ui.rs | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -134,10 +134,8 @@ impl UI { let mut new_x = 0; let mut new_y = 0; getyx(stdscr(), &mut new_y, &mut new_x); - while let Some(wchr) = get_wch() { - //while let Some(WchResult::Char(wch)) = get_wch() { - if let WchResult::Char(wch) = wchr { - let ch = wch as u8 as char; + while let input = getch() { + if let Some(ch) = char::from_u32(input as u32) { match ch { '\n' => { deleteln(); @@ -160,8 +158,8 @@ impl UI { self.buffer.push(ch); }, } - } else if let WchResult::KeyCode(kc) = wchr { - match kc { + } else { + match input { KEY_UP => { if self.history_place < 0 { self.history_place = self.history.len() as i32; |