forked from janek/mostr
feat(tasks): extend search depth by tags if appropriate
This commit is contained in:
parent
bb3bb1fd56
commit
4b59b273f5
16
src/tasks.rs
16
src/tasks.rs
|
@ -383,6 +383,22 @@ impl Tasks {
|
|||
|
||||
pub(crate) fn filtered_tasks<'a>(&'a self, position: Option<&'a EventId>, sparse: bool) -> Vec<&'a Task> {
|
||||
let mut current = self.resolve_tasks(self.children_of(position), sparse);
|
||||
if current.is_empty() {
|
||||
if !self.tags.is_empty() {
|
||||
let mut children = self.children_of(self.get_position_ref()).peekable();
|
||||
if children.peek().is_some() {
|
||||
current = self.resolve_tasks_rec(children, true, 9);
|
||||
if sparse {
|
||||
if current.is_empty() {
|
||||
println!("No tasks here matching{}", self.get_prompt_suffix());
|
||||
} else {
|
||||
println!("Found some matching tasks beyond specified view depth:");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let ids = current.iter().map(|t| t.get_id()).collect_vec();
|
||||
let mut bookmarks =
|
||||
if sparse && current.is_empty() {
|
||||
|
|
Loading…
Reference in New Issue