Skip to content

Commit

Permalink
better messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
extrawurst committed Aug 27, 2023
1 parent 0fa50d5 commit 02c220c
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions src/tabs/revlog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,35 +304,39 @@ impl Revlog {
}

fn draw_search<B: Backend>(&self, f: &mut Frame<B>, area: Rect) {
let text = match &self.search {
LogSearch::Searching(_, options) => {
format!(
"'{}' (pending results...)",
options.search_pattern.clone()
)
}
let (text, title) = match &self.search {
LogSearch::Searching(_, options) => (
format!("'{}'", options.search_pattern.clone()),
String::from("(pending results...)"),
),
LogSearch::Results(results) => {
format!(
"'{}' (duration: {:?})",
results.options.search_pattern.clone(),
results.duration,
let info = self.list.highlighted_selection_info();

(
format!(
"'{}' (duration: {:?})",
results.options.search_pattern.clone(),
results.duration,
),
format!(
"({}/{})",
(info.0 + 1).min(info.1),
info.1
),
)
}
LogSearch::Off => String::new(),
LogSearch::Off => (String::new(), String::new()),
};

let info = self.list.highlighted_selection_info();

f.render_widget(
Paragraph::new(text)
.block(
Block::default()
.title(Span::styled(
format!(
"{} ({}/{})",
"{} {}",
strings::POPUP_TITLE_LOG_SEARCH,
(info.0 + 1).min(info.1),
info.1
title
),
self.theme.title(true),
))
Expand Down

0 comments on commit 02c220c

Please sign in to comment.