mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-25 08:47:18 +02:00
fix: Resolve empty task list filter bug 🐛
This commit is contained in:
parent
8d21885a18
commit
786f76ecaf
1 changed files with 5 additions and 10 deletions
15
src/app.rs
15
src/app.rs
|
@ -1572,10 +1572,9 @@ impl TaskwarriorTui {
|
|||
task.arg("rc.confirmation=off");
|
||||
|
||||
let filter = if self.current_context_filter.is_empty() {
|
||||
self.filter.as_str().into()
|
||||
format!("'{}'", self.filter.as_str())
|
||||
} else {
|
||||
let t = format!("{} '{}'", self.filter.as_str(), self.current_context_filter);
|
||||
t
|
||||
format!("'{}' '{}'", self.filter.as_str(), self.current_context_filter)
|
||||
};
|
||||
|
||||
match shlex::split(&filter) {
|
||||
|
@ -3436,11 +3435,7 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn test_taskwarrior_tui() {
|
||||
let app = TaskwarriorTui::new("next");
|
||||
if let Err(_) = app {
|
||||
return;
|
||||
}
|
||||
let app = app.unwrap();
|
||||
let app = TaskwarriorTui::new("next").unwrap();
|
||||
assert!(app.task_by_index(0).is_none());
|
||||
|
||||
let app = TaskwarriorTui::new("next").unwrap();
|
||||
|
@ -3840,7 +3835,7 @@ mod tests {
|
|||
"│ │",
|
||||
"╰────────────────────────────────────────────────╯",
|
||||
"╭Filter Tasks────────────────────────────────────╮",
|
||||
"│status:pending -private │",
|
||||
"│(status:pending or status:waiting) │",
|
||||
"╰────────────────────────────────────────────────╯",
|
||||
]);
|
||||
|
||||
|
@ -4135,7 +4130,7 @@ mod tests {
|
|||
"│ID 27 │",
|
||||
"╰────────────────────────────────────────────────╯",
|
||||
"╭Filter Tasks────────────────────────────────────╮",
|
||||
"│status:pending -private │",
|
||||
"│(status:pending or status:waiting) │",
|
||||
"╰────────────────────────────────────────────────╯",
|
||||
]);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue