mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
fix: attemp 1 to fix input over preview
This commit is contained in:
parent
d0b6810cb3
commit
7f7f123f4a
2 changed files with 28 additions and 4 deletions
|
|
@ -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 {
|
||||
|
|
@ -176,10 +179,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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -184,11 +184,15 @@ impl<'a> Executor<'a> {
|
|||
};
|
||||
}
|
||||
|
||||
on!(close);
|
||||
on!(arrow);
|
||||
|
||||
match exec.cmd.as_str() {
|
||||
"help" => self.cx.help.toggle(KeymapLayer::Select),
|
||||
"close" => {
|
||||
self.cx.manager.active_mut().preview.reset(|_| true);
|
||||
self.cx.manager.peek(false);
|
||||
self.cx.select.close(exec)
|
||||
},
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
|
@ -207,11 +211,22 @@ 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.active_mut().preview.reset(|_| true);
|
||||
self.cx.manager.peek(false);
|
||||
return self.cx.input.close(exec);
|
||||
}
|
||||
else if exec.cmd.as_str() == "escape" {
|
||||
if self.cx.input.mode() == InputMode::Normal {
|
||||
self.cx.manager.active_mut().preview.reset(|_| true);
|
||||
self.cx.manager.peek(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