mirror of
https://github.com/sxyazi/yazi.git
synced 2024-12-01 10:17:47 +03:00
fix: hover(Some)
should track the location of the file regardless
This commit is contained in:
parent
085f7e39bf
commit
59f79a2ae5
@ -25,9 +25,15 @@ impl Manager {
|
||||
}
|
||||
|
||||
pub fn hover(&mut self, opt: impl Into<Opt>) {
|
||||
// Hover on the file
|
||||
let opt = opt.into() as Opt;
|
||||
render!(self.current_mut().repos(opt.url));
|
||||
|
||||
// Hover on the file
|
||||
render!(self.current_mut().repos(opt.url.as_ref()));
|
||||
if opt.url.zip(self.current().hovered()).is_some_and(|(u, f)| u == f.url) {
|
||||
// `hover(Some)` occurs after user actions, such as create, rename, reveal, etc.
|
||||
// At this point, it's intuitive to track the location of this file regardless.
|
||||
self.current_mut().tracing = true;
|
||||
}
|
||||
|
||||
// Re-peek
|
||||
self.peek(false);
|
||||
|
@ -32,7 +32,7 @@ function M:preload()
|
||||
|
||||
local i, j = 1, 0
|
||||
repeat
|
||||
local next, event = child:read_line_with { timeout = 100 }
|
||||
local next, event = child:read_line_with { timeout = 300 }
|
||||
if event == 3 then
|
||||
flush(true)
|
||||
goto continue
|
||||
|
@ -9,12 +9,11 @@ pub struct Cha;
|
||||
impl Cha {
|
||||
pub fn register(lua: &Lua) -> mlua::Result<()> {
|
||||
lua.register_userdata_type::<yazi_shared::fs::Cha>(|reg| {
|
||||
reg.add_field_method_get("is_link", |_, me| Ok(me.is_link()));
|
||||
reg.add_field_method_get("is_hidden", |_, me| Ok(me.is_hidden()));
|
||||
|
||||
// Metadata
|
||||
reg.add_field_method_get("is_dir", |_, me| Ok(me.is_dir()));
|
||||
reg.add_field_method_get("is_symlink", |_, me| Ok(me.is_link()));
|
||||
reg.add_field_method_get("is_hidden", |_, me| Ok(me.is_hidden()));
|
||||
reg.add_field_method_get("is_link", |_, me| Ok(me.is_link()));
|
||||
reg.add_field_method_get("is_bad_link", |_, me| Ok(me.is_bad_link()));
|
||||
|
||||
#[cfg(unix)]
|
||||
{
|
||||
reg.add_field_method_get("is_block_device", |_, me| Ok(me.is_block_device()));
|
||||
|
Loading…
Reference in New Issue
Block a user