Skip to content

Commit

Permalink
backward search is working
Browse files Browse the repository at this point in the history
  • Loading branch information
janstarke committed May 13, 2024
1 parent a7f8f03 commit 83f07fc
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/bin/evtxview/tui/evtx_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,22 @@ impl EvtxTable {
}

pub fn find_previous(&self, starting_at: usize, search_string: &str) -> Option<usize> {
None
if let Ok(data) = self.data.lock() {
data.rows
.iter()
.filter(|rc| self.filter_row(rc))
.enumerate()
.filter(|(idx, _rc)| *idx < starting_at)
.filter_map(|(idx, rc)| {
if rc.raw_value().contains(search_string) {
Some(idx)
} else {
None
}
}).last()
} else {
None
}
}
}

Expand Down

0 comments on commit 83f07fc

Please sign in to comment.