forked from janek/mostr
1
0
Fork 0

style(tasks): some bits of documentation

This commit is contained in:
xeruf 2024-09-14 16:17:30 +03:00
parent 0744e86922
commit cb75a5749f
1 changed files with 8 additions and 4 deletions

View File

@ -201,9 +201,10 @@ impl Tasks {
last = new; last = new;
} }
} }
// TODO show history for active tags
("Your Time-Tracking History:".to_string(), Box::from(full.into_iter())) ("Your Time-Tracking History:".to_string(), Box::from(full.into_iter()))
} else { } else {
("You have nothing tracked yet".to_string(), Box::from(empty())) ("You have nothing time-tracked yet".to_string(), Box::from(empty()))
} }
} }
Some(id) => { Some(id) => {
@ -680,8 +681,8 @@ impl Tasks {
filtered_fuzzy.push(task.event.id) filtered_fuzzy.push(task.event.id)
} }
} }
for task in self.tasks.values() {
// Find global exact match // Find global exact match
for task in self.tasks.values() {
if task.get_filter_title().to_ascii_lowercase() == lowercase_arg && if task.get_filter_title().to_ascii_lowercase() == lowercase_arg &&
// exclude closed tasks and their subtasks // exclude closed tasks and their subtasks
!self.traverse_up_from(Some(*task.get_id())).any(|t| t.pure_state() == State::Closed) { !self.traverse_up_from(Some(*task.get_id())).any(|t| t.pure_state() == State::Closed) {
@ -701,7 +702,10 @@ impl Tasks {
filtered filtered
} }
/// Finds out what to do with the given string. /// Finds out what to do with the given string, one of:
/// - filtering the visible tasks
/// - entering the only matching task
/// - creating a new task
/// Returns an EventId if a new Task was created. /// Returns an EventId if a new Task was created.
pub(crate) fn filter_or_create(&mut self, position: Option<&EventId>, arg: &str) -> Option<EventId> { pub(crate) fn filter_or_create(&mut self, position: Option<&EventId>, arg: &str) -> Option<EventId> {
let filtered = self.get_matching(position, arg); let filtered = self.get_matching(position, arg);