pub fn search(&mut self, forward: bool) -> io::Result<()> {
        if !self.is_search() {
            self.refresh_search(forward);
        } else if self.history_subset_index.len() > 0 {
            self.history_subset_loc = if let Some(p) = self.history_subset_loc {
                if forward {
                    if p < self.history_subset_index.len() - 1 { Some(p + 1) } else { Some(0) }
                } else {
                    if p > 0 { Some(p - 1) } else { Some(self.history_subset_index.len() - 1) }
                }
            } else {
                None
            };
        }
        self.display()?;
        Ok(())
    }
/// Begin or continue a search through history.  If forward is true then start at top (or
/// current_history_loc if set). If started with forward true then incremental search goes
/// forward (top to bottom) other wise reverse (bottom to top).  It is valid to continue a
/// search with forward changed (i.e. reverse search direction for one result).
Begin or continue a search through history.  If forward is true then start at top (or
current_history_loc if set). If started with forward true then incremental search goes
forward (top to bottom) other wise reverse (bottom to top).  It is valid to continue a
search with forward changed .
Begin or continue a search through history . If forward is true then start at top ( or current_history_loc if set ) . If started with forward true then incremental search goes forward ( top to bottom ) other wise reverse ( bottom to top ) . It is valid to continue a search with forward changed .
pub fn search(&mut self, forward: bool) -> io::Result<()> {
        if !self.is_search() {
            self.refresh_search(forward);
        } else if self.history_subset_index.len() > 0 {
            self.history_subset_loc = if let Some(p) = self.history_subset_loc {
                if forward {
                    if p < self.history_subset_index.len() - 1 { Some(p + 1) } else { Some(0) }
                } else {
                    if p > 0 { Some(p - 1) } else { Some(self.history_subset_index.len() - 1) }
                }
            } else {
                None
            };
        }
        self.display()?;
        Ok(())
    }
pub fn search ( & mut self , forward : bool ) -> io :: Result < ( ) > { if ! self . is_search ( ) { self . refresh_search ( forward ) ; } else if self . history_subset_index . len ( ) > 0 { self . history_subset_loc = if let Some ( p ) = self . history_subset_loc { if forward { if p < self . history_subset_index . len ( ) - 1 { Some ( p + 1 ) } else { Some ( 0 ) } } else { if p > 0 { Some ( p - 1 ) } else { Some ( self . history_subset_index . len ( ) - 1 ) } } } else { None } ; } self . display ( ) ? ; Ok ( ( ) ) }
Begin or continue a search through history.
Begin or continue a search through history .
&mut self
forward
bool
&mut self
forward
bool