Fix quit by :q

This commit is contained in:
daa 2017-07-09 14:05:55 +03:00
parent 225a2bf6c7
commit 59a735c521
2 changed files with 8 additions and 2 deletions

View File

@ -34,7 +34,7 @@ pub const MINIMUM_SUPPORTED_NVIM_VERSION: &str = "0.2";
macro_rules! idle_cb_call { macro_rules! idle_cb_call {
($state:ident.$cb:ident($( $x:expr ),*)) => ( ($state:ident.$cb:ident($( $x:expr ),*)) => (
gtk::idle_add(move || { glib::idle_add(move || {
if let Some(ref cb) = $state.borrow().$cb { if let Some(ref cb) = $state.borrow().$cb {
(&mut *cb.borrow_mut())($($x),*); (&mut *cb.borrow_mut())($($x),*);
} }

View File

@ -125,7 +125,13 @@ impl Ui {
shell.grab_focus(); shell.grab_focus();
let comps_ref = self.comps.clone(); let comps_ref = self.comps.clone();
shell.set_detach_cb(Some(move || comps_ref.borrow().close_window())); shell.set_detach_cb(Some(move || {
let comps_ref = comps_ref.clone();
gtk::idle_add(move || {
comps_ref.borrow().close_window();
Continue(false)
});
}));
} }
fn create_main_menu(&self, app: &gtk::Application) { fn create_main_menu(&self, app: &gtk::Application) {