mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
Fix hovered_and_selected to return hovered url twice if no selected urls
This commit is contained in:
parent
3d385bc184
commit
97781fa3b0
1 changed files with 7 additions and 3 deletions
|
|
@ -59,10 +59,14 @@ impl Tab {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn hovered_and_selected(&self) -> Vec<&Url> {
|
pub fn hovered_and_selected(&self) -> Vec<&Url> {
|
||||||
if let Some(h) = self.current.hovered() {
|
let Some(h) = self.current.hovered() else {
|
||||||
[&h.url].into_iter().chain(self.selected.iter()).collect()
|
return vec![];
|
||||||
|
};
|
||||||
|
|
||||||
|
if self.selected.is_empty() {
|
||||||
|
vec![&h.url, &h.url]
|
||||||
} else {
|
} else {
|
||||||
vec![]
|
[&h.url].into_iter().chain(self.selected.iter()).collect()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue