mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
refactor: dispatchers no longer go through async scheduling to improve reactivity (#60)
This commit is contained in:
parent
edd0ad7997
commit
8fd3d15918
1 changed files with 5 additions and 3 deletions
|
|
@ -35,7 +35,7 @@ impl App {
|
||||||
Event::Resize(..) => app.dispatch_resize(),
|
Event::Resize(..) => app.dispatch_resize(),
|
||||||
Event::Stop(state, tx) => app.dispatch_stop(state, tx),
|
Event::Stop(state, tx) => app.dispatch_stop(state, tx),
|
||||||
Event::Ctrl(ctrl, layer) => app.dispatch_ctrl(ctrl, layer),
|
Event::Ctrl(ctrl, layer) => app.dispatch_ctrl(ctrl, layer),
|
||||||
event => app.dispatch_module(event).await,
|
event => app.dispatch_module(event),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
@ -107,12 +107,14 @@ impl App {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn dispatch_module(&mut self, event: Event) {
|
fn dispatch_module(&mut self, event: Event) {
|
||||||
let manager = &mut self.cx.manager;
|
let manager = &mut self.cx.manager;
|
||||||
let tasks = &mut self.cx.tasks;
|
let tasks = &mut self.cx.tasks;
|
||||||
match event {
|
match event {
|
||||||
Event::Cd(path) => {
|
Event::Cd(path) => {
|
||||||
manager.active_mut().cd(absolute_path(path).await).await;
|
futures::executor::block_on(async {
|
||||||
|
manager.active_mut().cd(absolute_path(path).await).await;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
Event::Refresh => {
|
Event::Refresh => {
|
||||||
manager.refresh();
|
manager.refresh();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue