diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-02-16 15:45:05 -0500 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-02-16 15:50:25 -0500 |
commit | 98d0ce7e70f9febf804cda7473f5e9f7f180fe91 (patch) | |
tree | c8c8dd60d9e6502202b910e64f79cd75b933d05d /src/util | |
parent | d788f8d740be85bb014ddfa005156723f0a31e99 (diff) |
remove ncurses dependency
- clean up code
- update theme config
- fix localstate tracking file selection not selecting proper files
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/event.rs | 4 | ||||
-rw-r--r-- | src/util/load_child.rs | 5 | ||||
-rw-r--r-- | src/util/menu.rs | 3 | ||||
-rw-r--r-- | src/util/textfield.rs | 2 |
4 files changed, 5 insertions, 9 deletions
diff --git a/src/util/event.rs b/src/util/event.rs index 4413cca..c6f8b85 100644 --- a/src/util/event.rs +++ b/src/util/event.rs @@ -29,7 +29,6 @@ pub struct Events { event_rx: mpsc::Receiver<Event>, pub sync_tx: mpsc::SyncSender<()>, sync_rx: mpsc::Receiver<()>, - input_handle: thread::JoinHandle<()>, // fileio_handle: thread::JoinHandle<()>, } @@ -46,7 +45,7 @@ impl Events { let (sync_tx, sync_rx) = mpsc::sync_channel(1); let (event_tx, event_rx) = mpsc::channel(); - let input_handle = { + { let sync_tx = sync_tx.clone(); let event_tx = event_tx.clone(); thread::spawn(move || { @@ -74,7 +73,6 @@ impl Events { event_rx, sync_tx, sync_rx, - input_handle, prefix, } } diff --git a/src/util/load_child.rs b/src/util/load_child.rs index cb32090..386cd63 100644 --- a/src/util/load_child.rs +++ b/src/util/load_child.rs @@ -7,7 +7,7 @@ use crate::ui::TuiBackend; pub struct LoadChild {} impl LoadChild { - pub fn load_child(context: &mut JoshutoContext, backend: &mut TuiBackend) { + pub fn load_child(context: &mut JoshutoContext) -> std::io::Result<()> { let curr_tab = &mut context.tabs[context.curr_tab_index]; let mut path: Option<PathBuf> = None; @@ -23,8 +23,9 @@ impl LoadChild { if path.is_dir() { curr_tab .history - .create_or_update(path.as_path(), &context.config_t.sort_option); + .create_or_update(path.as_path(), &context.config_t.sort_option)?; } } + Ok(()) } } diff --git a/src/util/menu.rs b/src/util/menu.rs index 67cb19d..6a9b5b2 100644 --- a/src/util/menu.rs +++ b/src/util/menu.rs @@ -4,10 +4,9 @@ use std::iter::Iterator; use termion::clear; use termion::cursor::Goto; use termion::event::Key; -use termion::input::TermRead; use termion::raw::IntoRawMode; use termion::screen::AlternateScreen; -use tui::backend::{Backend, TermionBackend}; +use tui::backend::TermionBackend; use tui::layout::{Constraint, Direction, Layout, Rect}; use tui::style::{Color, Style}; use tui::widgets::{Block, Borders, List, Paragraph, Text, Widget}; diff --git a/src/util/textfield.rs b/src/util/textfield.rs index 90f58f1..b8d9edd 100644 --- a/src/util/textfield.rs +++ b/src/util/textfield.rs @@ -20,8 +20,6 @@ use crate::ui::TuiBackend; use crate::util::event::{Event, Events}; use crate::window; -use crate::KEYMAP_T; - struct CompletionTracker { pub index: usize, pub pos: usize, |