mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-25 17:57:19 +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");
|
task.arg("rc.confirmation=off");
|
||||||
|
|
||||||
let filter = if self.current_context_filter.is_empty() {
|
let filter = if self.current_context_filter.is_empty() {
|
||||||
self.filter.as_str().into()
|
format!("'{}'", self.filter.as_str())
|
||||||
} else {
|
} else {
|
||||||
let t = format!("{} '{}'", self.filter.as_str(), self.current_context_filter);
|
format!("'{}' '{}'", self.filter.as_str(), self.current_context_filter)
|
||||||
t
|
|
||||||
};
|
};
|
||||||
|
|
||||||
match shlex::split(&filter) {
|
match shlex::split(&filter) {
|
||||||
|
@ -3436,11 +3435,7 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_taskwarrior_tui() {
|
fn test_taskwarrior_tui() {
|
||||||
let app = TaskwarriorTui::new("next");
|
let app = TaskwarriorTui::new("next").unwrap();
|
||||||
if let Err(_) = app {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let app = app.unwrap();
|
|
||||||
assert!(app.task_by_index(0).is_none());
|
assert!(app.task_by_index(0).is_none());
|
||||||
|
|
||||||
let app = TaskwarriorTui::new("next").unwrap();
|
let app = TaskwarriorTui::new("next").unwrap();
|
||||||
|
@ -3840,7 +3835,7 @@ mod tests {
|
||||||
"│ │",
|
"│ │",
|
||||||
"╰────────────────────────────────────────────────╯",
|
"╰────────────────────────────────────────────────╯",
|
||||||
"╭Filter Tasks────────────────────────────────────╮",
|
"╭Filter Tasks────────────────────────────────────╮",
|
||||||
"│status:pending -private │",
|
"│(status:pending or status:waiting) │",
|
||||||
"╰────────────────────────────────────────────────╯",
|
"╰────────────────────────────────────────────────╯",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -4135,7 +4130,7 @@ mod tests {
|
||||||
"│ID 27 │",
|
"│ID 27 │",
|
||||||
"╰────────────────────────────────────────────────╯",
|
"╰────────────────────────────────────────────────╯",
|
||||||
"╭Filter Tasks────────────────────────────────────╮",
|
"╭Filter Tasks────────────────────────────────────╮",
|
||||||
"│status:pending -private │",
|
"│(status:pending or status:waiting) │",
|
||||||
"╰────────────────────────────────────────────────╯",
|
"╰────────────────────────────────────────────────╯",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue