diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-06-04 10:49:47 -0400 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-06-04 13:26:09 -0400 |
commit | 7036a7e6ff57b7e5e4b99133ea7466a3b24bf0ce (patch) | |
tree | a23141ae6474748f7ae49e04316136f2906fe7bd /src/run.rs | |
parent | da20212f32c8b43400d0aec2af39376651f32b9d (diff) |
revert back to previous printing method
- fix index out of bounds error when multiple threads are running
Diffstat (limited to 'src/run.rs')
-rw-r--r-- | src/run.rs | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -52,7 +52,7 @@ fn reload_tab( context: &mut JoshutoContext, view: &JoshutoView, ) -> Result<(), std::io::Error> { - ReloadDirList::reload(index, context, view)?; + ReloadDirList::reload(index, context)?; if index == context.curr_tab_index { let dirty_tab = &mut context.tabs[index]; dirty_tab.refresh(view, &context.config_t); @@ -94,6 +94,7 @@ fn process_threads(context: &mut JoshutoContext, view: &JoshutoView) -> Result<( let thread = context.threads.swap_remove(i); join_thread(context, thread, view)?; ncurses::doupdate(); + break; } Ok(progress_info) => { ui::draw_progress_bar( @@ -111,6 +112,7 @@ fn process_threads(context: &mut JoshutoContext, view: &JoshutoView) -> Result<( #[inline] fn resize_handler(context: &mut JoshutoContext, view: &JoshutoView) { ui::redraw_tab_view(&view.tab_win, &context); + let curr_tab = &mut context.tabs[context.curr_tab_index]; curr_tab.refresh(view, &context.config_t); ncurses::doupdate(); @@ -122,9 +124,10 @@ fn init_context(context: &mut JoshutoContext, view: &JoshutoView) { Ok(tab) => { context.tabs.push(tab); context.curr_tab_index = context.tabs.len() - 1; + + ui::redraw_tab_view(&view.tab_win, &context); let curr_tab = &mut context.tabs[context.curr_tab_index]; curr_tab.refresh(view, &context.config_t); - ui::redraw_tab_view(&view.tab_win, &context); ncurses::doupdate(); } Err(e) => { |