forked from janek/mostr
feat: feedback when filter does not match
This commit is contained in:
parent
930c6b9c38
commit
3e056eb2b6
|
@ -406,13 +406,13 @@ async fn main() {
|
|||
match arg {
|
||||
None => match tasks.get_position() {
|
||||
None => {
|
||||
info!("Filtering for Procedures");
|
||||
tasks.set_filter(
|
||||
tasks.filtered_tasks(None)
|
||||
.filter(|t| t.pure_state() == State::Procedure)
|
||||
.map(|t| t.event.id)
|
||||
.collect()
|
||||
);
|
||||
info!("Filtering for procedures");
|
||||
}
|
||||
Some(id) => {
|
||||
tasks.set_state_for(id, "", State::Procedure);
|
||||
|
|
|
@ -480,6 +480,9 @@ impl Tasks {
|
|||
// Movement and Selection
|
||||
|
||||
pub(crate) fn set_filter(&mut self, view: Vec<EventId>) {
|
||||
if view.is_empty() {
|
||||
warn!("No match for filter!")
|
||||
}
|
||||
self.view = view;
|
||||
}
|
||||
|
||||
|
@ -565,7 +568,7 @@ impl Tasks {
|
|||
if arg.len() > 2 {
|
||||
Some(self.make_task(arg))
|
||||
} else {
|
||||
warn!("Not creating task under 3 chars to avoid silly mistakes");
|
||||
warn!("Name of a task needs to have at least 3 characters");
|
||||
None
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue