Skip to content

Commit

Permalink
refactor(term): rename filter method
Browse files Browse the repository at this point in the history
  • Loading branch information
ymgyt committed Apr 27, 2024
1 parent 37c5d9f commit 4cc525f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 24 deletions.
2 changes: 1 addition & 1 deletion crates/synd_term/src/application/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ impl Application {
}
Command::PromptChanged => {
if self.components.filter.is_search_active() {
let filter = self.components.filter.filter();
let filter = self.components.filter.feed_filter();
self.apply_feed_filter(filter);
self.should_render = true;
}
Expand Down
6 changes: 1 addition & 5 deletions crates/synd_term/src/ui/components/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,7 @@ impl Filter {
}

#[must_use]
pub fn filter(&self) -> FeedFilter {
self.feed_filter()
}

fn feed_filter(&self) -> FeedFilter {
pub fn feed_filter(&self) -> FeedFilter {
let mut matcher = self.matcher.clone();
matcher.update_needle(self.prompt.borrow().line());
FeedFilter {
Expand Down
18 changes: 0 additions & 18 deletions crates/synd_term/src/ui/widgets/prompt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,23 +95,5 @@ impl Prompt {
spans.push(Span::from(" ").reversed());
};
Line::from(spans).render(area, buf);
/*
let text = Text::from(self.line.clone());
text.render(area, buf);
if cursor == RenderCursor::Enable {
let cursor_pos = self.line.graphemes(true).count();
let area = Rect {
#[allow(clippy::cast_possible_truncation)]
x: area.x + cursor_pos as u16,
y: area.y,
width: 1,
height: 1,
};
let cursor = Text::from(" ").reversed();
cursor.render(area, buf);
}
*/
}
}

0 comments on commit 4cc525f

Please sign in to comment.