mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
fix: adapting to clear widget
This commit is contained in:
commit
b0f9c7aaba
4 changed files with 569198 additions and 5 deletions
569164
Szeliski_CVAABook_2ndEd.pdf
Normal file
569164
Szeliski_CVAABook_2ndEd.pdf
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -24,4 +24,9 @@ impl Manager {
|
|||
}
|
||||
false
|
||||
}
|
||||
|
||||
pub fn peek_refresh(&mut self, sequent: bool) -> bool {
|
||||
self.active_mut().preview.reset(|_| true);
|
||||
self.peek(sequent)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,9 @@ use yazi_config::{keymap::{Exec, Key, KeymapLayer}, BOOT};
|
|||
use yazi_core::{emit, files::FilesOp, input::InputMode, Ctx, Event};
|
||||
use yazi_shared::Term;
|
||||
|
||||
use yazi_adaptor::ADAPTOR;
|
||||
// use yazi_config::MANAGER;
|
||||
|
||||
use crate::{Executor, Logs, Panic, Root, Signals};
|
||||
|
||||
pub(super) struct App {
|
||||
|
|
@ -194,10 +197,16 @@ impl App {
|
|||
|
||||
Event::Select(opt, tx) => {
|
||||
self.cx.select.show(opt, tx);
|
||||
let Rect { x, y, width, height} = self.cx.area(&self.cx.select.position);
|
||||
let select_area = Rect {x:x+1, y:y+1, width:width-2, height:height-2};
|
||||
ADAPTOR.image_hide(select_area).ok();
|
||||
emit!(Render);
|
||||
}
|
||||
Event::Input(opt, tx) => {
|
||||
self.cx.input.show(opt, tx);
|
||||
let Rect { x, y, width, height} = self.cx.area(&self.cx.input.position);
|
||||
let input_area = Rect {x:x+1, y:y+1, width:width-2, height:height-2};
|
||||
ADAPTOR.image_hide(input_area).ok();
|
||||
emit!(Render);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -164,12 +164,15 @@ impl<'a> Executor<'a> {
|
|||
};
|
||||
}
|
||||
|
||||
on!(toggle, "close");
|
||||
on!(arrow);
|
||||
on!(inspect);
|
||||
on!(cancel);
|
||||
|
||||
match exec.cmd.as_str() {
|
||||
"close" => {
|
||||
self.cx.manager.peek_refresh(false);
|
||||
self.cx.tasks.toggle(exec)
|
||||
},
|
||||
"help" => self.cx.help.toggle(KeymapLayer::Tasks),
|
||||
_ => false,
|
||||
}
|
||||
|
|
@ -184,11 +187,14 @@ impl<'a> Executor<'a> {
|
|||
};
|
||||
}
|
||||
|
||||
on!(close);
|
||||
on!(arrow);
|
||||
|
||||
match exec.cmd.as_str() {
|
||||
"help" => self.cx.help.toggle(KeymapLayer::Select),
|
||||
"close" => {
|
||||
self.cx.manager.peek_refresh(false);
|
||||
self.cx.select.close(exec)
|
||||
},
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
|
@ -207,11 +213,20 @@ impl<'a> Executor<'a> {
|
|||
};
|
||||
}
|
||||
|
||||
on!(close);
|
||||
on!(escape);
|
||||
on!(move_, "move");
|
||||
|
||||
if exec.cmd.as_str() == "complete" {
|
||||
|
||||
if exec.cmd.as_str() == "close" {
|
||||
self.cx.manager.peek_refresh(false);
|
||||
return self.cx.input.close(exec);
|
||||
}
|
||||
else if exec.cmd.as_str() == "escape" {
|
||||
if self.cx.input.mode() == InputMode::Normal {
|
||||
self.cx.manager.peek_refresh(false);
|
||||
}
|
||||
return self.cx.input.escape(exec);
|
||||
}
|
||||
else if exec.cmd.as_str() == "complete" {
|
||||
return if exec.args.is_empty() {
|
||||
self.cx.completion.trigger(exec)
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue