From ff2ea896e99a0909e2d1537bf218db5562beb5f2 Mon Sep 17 00:00:00 2001 From: Dheepak Krishnamurthy Date: Fri, 17 Sep 2021 06:30:07 -0600 Subject: [PATCH 1/5] =?UTF-8?q?docs:=20Update=20README.md=20=F0=9F=93=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 9e6b8a6..e2efd24 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ A Terminal User Interface for [Taskwarrior](https://taskwarrior.org/). Showcase of features: +[![](https://img.youtube.com/vi/0ZdkfNrIAcw/0.jpg)](https://www.youtube.com/watch?v=0ZdkfNrIAcw) + **User Interface** ![](https://user-images.githubusercontent.com/1813121/113251568-bdef2380-927f-11eb-8cb6-5d95b00eee53.gif) From 17dd15f7f4700b634fb0ea91ab7b39d32ac8e1cc Mon Sep 17 00:00:00 2001 From: Dheepak Krishnamurthy Date: Wed, 29 Sep 2021 15:58:22 -0600 Subject: [PATCH 2/5] =?UTF-8?q?fix(autocomplete):=20Use=20correct=20cursor?= =?UTF-8?q?=20location=20after=20selection=20=F0=9F=90=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.rs | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/app.rs b/src/app.rs index 05d9905..4571a47 100644 --- a/src/app.rs +++ b/src/app.rs @@ -2475,8 +2475,9 @@ impl TaskwarriorTuiApp { if self.show_completion_pane { self.show_completion_pane = false; if let Some(s) = self.completion_list.selected() { - let s = format!("{}{}", self.modify.as_str(), &s); - self.modify.update(&s, s.len()); + let (before, after) = self.modify.as_str().split_at(self.modify.pos()); + let fs = format!("{}{}{}", before, s, after); + self.modify.update(&fs, self.modify.pos() + s.len()); } self.completion_list.unselect(); } else { @@ -2574,8 +2575,9 @@ impl TaskwarriorTuiApp { if self.show_completion_pane { self.show_completion_pane = false; if let Some(s) = self.completion_list.selected() { - let s = format!("{}{}", self.command.as_str(), s); - self.command.update(&s, s.len()); + let (before, after) = self.command.as_str().split_at(self.command.pos()); + let fs = format!("{}{}{}", before, s, after); + self.command.update(&fs, self.command.pos() + s.len()); } self.completion_list.unselect(); } else { @@ -2655,8 +2657,9 @@ impl TaskwarriorTuiApp { if self.show_completion_pane { self.show_completion_pane = false; if let Some(s) = self.completion_list.selected() { - let s = format!("{}{}", self.command.as_str(), s); - self.command.update(&s, s.len()); + let (before, after) = self.command.as_str().split_at(self.command.pos()); + let fs = format!("{}{}{}", before, s, after); + self.command.update(&fs, self.command.pos() + s.len()); } self.completion_list.unselect(); } else { @@ -2755,8 +2758,9 @@ impl TaskwarriorTuiApp { if self.show_completion_pane { self.show_completion_pane = false; if let Some(s) = self.completion_list.selected() { - let s = format!("{}{}", self.command.as_str(), s); - self.command.update(&s, s.len()); + let (before, after) = self.command.as_str().split_at(self.command.pos()); + let fs = format!("{}{}{}", before, s, after); + self.command.update(&fs, self.command.pos() + s.len()); } self.completion_list.unselect(); } else { @@ -2837,8 +2841,9 @@ impl TaskwarriorTuiApp { if self.show_completion_pane { self.show_completion_pane = false; if let Some(s) = self.completion_list.selected() { - let s = format!("{}{}", self.filter.as_str(), s); - self.filter.update(&s, s.len()); + let (before, after) = self.filter.as_str().split_at(self.filter.pos()); + let fs = format!("{}{}{}", before, s, after); + self.filter.update(&fs, self.filter.pos() + s.len()); } self.completion_list.unselect(); self.dirty = true; From 9501856ecfda4253cca7f8a0d1042aad52b7edb3 Mon Sep 17 00:00:00 2001 From: Dheepak Krishnamurthy Date: Wed, 29 Sep 2021 16:12:01 -0600 Subject: [PATCH 3/5] =?UTF-8?q?build(release):=20Bump=20to=20v0.13.34=20?= =?UTF-8?q?=F0=9F=9B=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index badde67..f6f1f20 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1394,7 +1394,7 @@ dependencies = [ [[package]] name = "taskwarrior-tui" -version = "0.13.33" +version = "0.13.34" dependencies = [ "anyhow", "async-std", diff --git a/Cargo.toml b/Cargo.toml index 139f727..9b81879 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "taskwarrior-tui" -version = "0.13.33" +version = "0.13.34" license = "MIT" description = "A Taskwarrior Terminal User Interface" repository = "https://github.com/kdheepak/taskwarrior-tui/" From 0890cdf037bb6ebb7beb8b5b40137cf1089354fa Mon Sep 17 00:00:00 2001 From: Dheepak Krishnamurthy Date: Sun, 3 Oct 2021 00:34:03 -0600 Subject: [PATCH 4/5] =?UTF-8?q?fix:=20Use=20saturating=20sub=20instead=20o?= =?UTF-8?q?f=20minus=20=F0=9F=90=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app.rs b/src/app.rs index 4571a47..54aaa1d 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1218,7 +1218,7 @@ impl TaskwarriorTuiApp { if !self.task_details.contains_key(&task_uuid) || task_uuid == current_task_uuid { let output_fut = async_std::process::Command::new("task") .arg("rc.color=off") - .arg(format!("rc.defaultwidth={}", self.terminal_width - 2)) + .arg(format!("rc.defaultwidth={}", self.terminal_width.saturating_sub(2))) .arg(format!("{}", task_uuid)) .output(); output_futs.push(output_fut); From 61a404049b2d883c3c93f70addd709a9be1ebb10 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Fri, 8 Oct 2021 14:29:00 -0400 Subject: [PATCH 5/5] Fix report for taskwarrior 2.6 Filters were being applied after the `export`. This resulted in stuff like task templates showing up in the task report. If we add the filters before the `export` then everything works as expected. Also add `TEMPLATE` as it is a new virtual tag. --- src/app.rs | 3 ++- src/task_report.rs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app.rs b/src/app.rs index 54aaa1d..f273561 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1484,7 +1484,6 @@ impl TaskwarriorTuiApp { task.arg("rc.json.array=on"); task.arg("rc.confirmation=off"); - task.arg("export"); let filter = if !self.current_context_filter.is_empty() { let t = format!("{} '\\({}\\)'", self.filter.as_str(), self.current_context_filter); @@ -1504,6 +1503,8 @@ impl TaskwarriorTuiApp { } } + task.arg("export"); + let output = task.output()?; let data = String::from_utf8_lossy(&output.stdout); let error = String::from_utf8_lossy(&output.stderr); diff --git a/src/task_report.rs b/src/task_report.rs index f2d02c3..c9bfc70 100644 --- a/src/task_report.rs +++ b/src/task_report.rs @@ -80,6 +80,7 @@ impl TaskReportTable { "LATEST", "RECURRING", "INSTANCE", + "TEMPLATE", ]; let mut task_report_table = Self { labels: vec![],