mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-25 08:47:18 +02:00
Fix crashes
This commit is contained in:
parent
75141ef561
commit
b7b6a0f65c
2 changed files with 22 additions and 1 deletions
|
@ -278,6 +278,9 @@ impl App {
|
|||
self.export_headers();
|
||||
}
|
||||
pub fn next(&mut self) {
|
||||
if self.tasks.len() == 0 {
|
||||
return
|
||||
}
|
||||
let i = match self.state.selected() {
|
||||
Some(i) => {
|
||||
if i >= self.tasks.len() - 1 {
|
||||
|
@ -291,6 +294,9 @@ impl App {
|
|||
self.state.select(Some(i));
|
||||
}
|
||||
pub fn previous(&mut self) {
|
||||
if self.tasks.len() == 0 {
|
||||
return
|
||||
}
|
||||
let i = match self.state.selected() {
|
||||
Some(i) => {
|
||||
if i == 0 {
|
||||
|
@ -344,6 +350,7 @@ impl App {
|
|||
pub fn export_tasks(&mut self) {
|
||||
let mut task = Command::new("task");
|
||||
|
||||
task.arg("rc.json.array=on");
|
||||
task.arg("export");
|
||||
|
||||
match split(&self.filter) {
|
||||
|
@ -417,6 +424,8 @@ mod tests {
|
|||
let mut app = App::new();
|
||||
app.update();
|
||||
|
||||
println!("{:?}", app.tasks);
|
||||
|
||||
println!("{:?}", app.task_report_columns);
|
||||
println!("{:?}", app.task_report_labels);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue