qkzk / fm

dired/ranger like file manager
Other
16 stars 0 forks source link

idea: History navigation #94

Closed qkzk closed 2 months ago

qkzk commented 2 months ago

MSDN: History API

action after

history = A, B, C back : B (go(-1) -> A, go(0) -> B, go(1) -> C) - History = A, B, C visit: D => history = A, B, D

we need to know the index

#[derive(Default)]
struct History {
   index: usize,
   visited: Vec<PB>,
}

impl History {
  pub fn back(&mut self) -> Option<PB>;
  pub fn forward(&mut self) -> Option<PB>;
  pub fn go(&mut self, rel: isize) -> Option<PB>;
  pub fn visite(&mut self, pb PB);
}