Fix save button

This commit is contained in:
Adrian Woźniak 2019-05-31 17:22:06 +02:00
parent 794f47a601
commit 02f271a5c1

View File

@ -141,6 +141,7 @@ impl Application {
new_tasks.push(res); new_tasks.push(res);
app_state.set_open_file_modal(None); app_state.set_open_file_modal(None);
} }
UpdateResult::SaveCurrentFile => new_tasks.push(res),
_ => {} _ => {}
} }
} }
@ -174,15 +175,18 @@ impl Application {
app_state.scroll_by(-x.clone(), -y.clone()); app_state.scroll_by(-x.clone(), -y.clone());
} }
UpdateResult::WindowResize { width, height } => { UpdateResult::WindowResize { width, height } => {
let mut c = app_state.config().write().unwrap(); app_state
let w = width.clone(); .config()
let h = height.clone(); .write()
if w > 0 { .map(|ref mut c| {
c.set_width(w as u32); if *width > 0 {
c.set_width(*width as u32);
} }
if h > 0 { if *height > 0 {
c.set_height(h as u32); c.set_height(*height as u32);
} }
})
.unwrap_or_else(|_| println!("Failed to update window size"));
} }
UpdateResult::RefreshFsTree => unimplemented!(), UpdateResult::RefreshFsTree => unimplemented!(),
UpdateResult::OpenFile(file_path) => { UpdateResult::OpenFile(file_path) => {