mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-24 23:46:41 +02:00
feat: Fix completion for tags ✨
This commit is contained in:
parent
12b61f5469
commit
3806db2bcb
2 changed files with 14 additions and 2 deletions
13
src/app.rs
13
src/app.rs
|
@ -3447,9 +3447,18 @@ impl TaskwarriorTui {
|
|||
for task in &self.tasks {
|
||||
if let Some(tags) = task.tags() {
|
||||
for tag in tags {
|
||||
let t = format!("+{}", &tag);
|
||||
if !virtual_tags.contains(tag) {
|
||||
self.completion_list.insert(("tag".to_string(), t));
|
||||
self.completion_list
|
||||
.insert(("tag".to_string(), format!("tag:{}", &tag)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for task in &self.tasks {
|
||||
if let Some(tags) = task.tags() {
|
||||
for tag in tags {
|
||||
if !virtual_tags.contains(tag) {
|
||||
self.completion_list.insert(("+".to_string(), format!("+{}", &tag)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -180,6 +180,9 @@ impl CompletionList {
|
|||
} else if input.contains(':') {
|
||||
self.input = input.split_once(':').unwrap().1.to_string();
|
||||
self.helper.context = input.split_once(':').unwrap().0.to_string();
|
||||
} else if input.contains('+') {
|
||||
self.input = format!("+{}", input.split_once('+').unwrap().1);
|
||||
self.helper.context = "+".to_string();
|
||||
} else {
|
||||
self.input = input;
|
||||
self.helper.context = "attribute".to_string();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue