mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-24 16:21:04 +00:00
25 lines
471 B
Rust
25 lines
471 B
Rust
use yazi_shared::event::Cmd;
|
|
|
|
use crate::tab::Tab;
|
|
|
|
pub struct Opt;
|
|
impl From<()> for Opt {
|
|
fn from(_: ()) -> Self { Self }
|
|
}
|
|
impl From<Cmd> for Opt {
|
|
fn from(_: Cmd) -> Self { Self }
|
|
}
|
|
|
|
impl Tab {
|
|
pub fn back(&mut self, _: impl Into<Opt>) {
|
|
if let Some(url) = self.backstack.shift_backward().cloned() {
|
|
self.cd(url);
|
|
}
|
|
}
|
|
|
|
pub fn forward(&mut self, _: impl Into<Opt>) {
|
|
if let Some(url) = self.backstack.shift_forward().cloned() {
|
|
self.cd(url);
|
|
}
|
|
}
|
|
}
|