mirror of
https://github.com/sxyazi/yazi.git
synced 2024-09-11 18:38:19 +03:00
Re-peek after the hovered file changes
This commit is contained in:
parent
99dc0e389c
commit
3812ea2d3a
@ -221,7 +221,7 @@ impl Files {
|
||||
|
||||
let (hidden, items) = if let Some(filter) = &self.filter {
|
||||
urls.into_iter().partition(|u| {
|
||||
(u.is_hidden() && !self.show_hidden) || !u.file_name().is_some_and(|s| filter.matches(s))
|
||||
(!self.show_hidden && u.is_hidden()) || !u.file_name().is_some_and(|s| filter.matches(s))
|
||||
})
|
||||
} else if self.show_hidden {
|
||||
(vec![], urls)
|
||||
|
@ -35,9 +35,10 @@ impl Filter {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Eq)]
|
||||
#[derive(Default, PartialEq, Eq)]
|
||||
pub enum FilterCase {
|
||||
Smart,
|
||||
#[default]
|
||||
Sensitive,
|
||||
Insensitive,
|
||||
}
|
||||
|
@ -45,7 +45,9 @@ impl Tab {
|
||||
fn escape_select(&mut self) -> bool { self.select_all(Some(false)) }
|
||||
|
||||
#[inline]
|
||||
fn escape_filter(&mut self) -> bool { self.current.files.set_filter(None) }
|
||||
fn escape_filter(&mut self) -> bool {
|
||||
self.filter_do(super::filter::Opt { query: None, ..Default::default() })
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn escape_search(&mut self) -> bool { self.search_stop() }
|
||||
|
@ -5,11 +5,12 @@ use tokio_stream::{wrappers::UnboundedReceiverStream, StreamExt};
|
||||
use yazi_config::popup::InputCfg;
|
||||
use yazi_shared::{emit, event::Exec, Debounce, InputError, Layer};
|
||||
|
||||
use crate::{folder::{Filter, FilterCase}, input::Input, tab::Tab};
|
||||
use crate::{folder::{Filter, FilterCase}, input::Input, manager::Manager, tab::Tab};
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct Opt<'a> {
|
||||
query: Option<&'a str>,
|
||||
case: FilterCase,
|
||||
pub query: Option<&'a str>,
|
||||
pub case: FilterCase,
|
||||
}
|
||||
|
||||
impl<'a> From<&'a Exec> for Opt<'a> {
|
||||
@ -59,7 +60,9 @@ impl Tab {
|
||||
return false;
|
||||
}
|
||||
|
||||
self.current.repos(hovered);
|
||||
if self.current.repos(hovered) {
|
||||
Manager::_hover(None);
|
||||
}
|
||||
true
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user