A bunch of stuff

This commit is contained in:
Brian Buller 2021-03-17 12:37:26 -05:00
parent a925eec330
commit 23f96062f5
9 changed files with 41 additions and 36 deletions

View File

@ -5,9 +5,9 @@ import (
"os" "os"
"strings" "strings"
todotxt "github.com/br0xen/go-todotxt" todotxt "git.bullercodeworks.com/brian/go-todotxt"
"github.com/br0xen/termbox-screen" termboxScreen "git.bullercodeworks.com/brian/termbox-screen"
"github.com/br0xen/user-config" userConfig "git.bullercodeworks.com/brian/user-config"
termbox "github.com/nsf/termbox-go" termbox "github.com/nsf/termbox-go"
) )

12
go.mod
View File

@ -1,11 +1,13 @@
module git.bullercodeworks.com/brian/gask module git.bullercodeworks.com/brian/gask
go 1.16
require ( require (
git.bullercodeworks.com/brian/go-todotxt v1.0.0
git.bullercodeworks.com/brian/termbox-screen v0.0.0-20190712162752-c91f70ac38c6
git.bullercodeworks.com/brian/termbox-util v0.0.0-20200220160819-dc6d6950ba00
git.bullercodeworks.com/brian/user-config v0.0.0-20170914134719-16e743ec93a2
github.com/BurntSushi/toml v0.3.1 // indirect github.com/BurntSushi/toml v0.3.1 // indirect
github.com/br0xen/go-todotxt v0.0.0-20190220135311-c2c2ad14ad22
github.com/br0xen/termbox-util v0.0.0-20170904143325-de1d4c83380e
github.com/br0xen/user-config v0.0.0-20170914134719-16e743ec93a2
github.com/casimir/xdg-go v0.0.0-20160329195404-372ccc2180da // indirect github.com/casimir/xdg-go v0.0.0-20160329195404-372ccc2180da // indirect
github.com/mattn/go-runewidth v0.0.4 // indirect github.com/nsf/termbox-go v1.1.0
github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d
) )

28
go.sum
View File

@ -1,18 +1,18 @@
git.bullercodeworks.com/brian/go-todotxt v0.0.0-20190204043859-239b7c535cc7 h1:euAlecu5ui9tjcJKcPk+tmt7wMn+Lkon9p2OPClMlJA= git.bullercodeworks.com/brian/go-todotxt v0.0.0-20210317161427-e7c5dfe04c31 h1:E7WOx5fUe5fvDJ1Zr0tu+8bNT/0utxKCIskggm7cGzI=
git.bullercodeworks.com/brian/go-todotxt v0.0.0-20190204043859-239b7c535cc7/go.mod h1:MS8w9yuyAlDxjdxe/3mgfOovifM8aMbH7Z2Ac14J7N8= git.bullercodeworks.com/brian/go-todotxt v0.0.0-20210317161427-e7c5dfe04c31/go.mod h1:MS8w9yuyAlDxjdxe/3mgfOovifM8aMbH7Z2Ac14J7N8=
git.bullercodeworks.com/brian/go-todotxt v1.0.0 h1:FnezIGRtDBYHXx/CenjOKhtv35gR8Y7VGyNT+zpcX/k=
git.bullercodeworks.com/brian/go-todotxt v1.0.0/go.mod h1:MS8w9yuyAlDxjdxe/3mgfOovifM8aMbH7Z2Ac14J7N8=
git.bullercodeworks.com/brian/termbox-screen v0.0.0-20190712162752-c91f70ac38c6 h1:H9ZIWuAcWRHZ4NqXWiIv9RFS35U4wL90fiPm5kbbDJ8=
git.bullercodeworks.com/brian/termbox-screen v0.0.0-20190712162752-c91f70ac38c6/go.mod h1:ELIb2SMnFJN+1SY1cThGR55UQyke8AcFBHr9y071j90=
git.bullercodeworks.com/brian/termbox-util v0.0.0-20200220160819-dc6d6950ba00 h1:h2IQSbnljgd41m6uriwE3SewC5MsHez8cOrpgQ/OnF0=
git.bullercodeworks.com/brian/termbox-util v0.0.0-20200220160819-dc6d6950ba00/go.mod h1:AXQlE7+T+dNiQJwkGS3a5JVQJd8J32cTM8uv8iKQeiQ=
git.bullercodeworks.com/brian/user-config v0.0.0-20170914134719-16e743ec93a2 h1:Q8Ty2s2CN5i2E10UCCkpIHTVB22avGcP9HChuvqjEBU=
git.bullercodeworks.com/brian/user-config v0.0.0-20170914134719-16e743ec93a2/go.mod h1:7THeubmaACTBR+d+KeaRJCL0sOOLA3tz2w0mPwLtjU8=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/br0xen/go-todotxt v0.0.0-20190204043859-239b7c535cc7 h1:ocxG6X67fmRxY74Or1594ZjC02I9DH26G0xX6fHMA8U=
github.com/br0xen/go-todotxt v0.0.0-20190204043859-239b7c535cc7/go.mod h1:AmJKSVbee7+0JxWEd/79ButCY9e9NTfSUK+6DY+77Cg=
github.com/br0xen/go-todotxt v0.0.0-20190220135311-c2c2ad14ad22 h1:3cLwiVRGgCKmjSkxwLwapR+VLv3ixeBbbHJgNsF2QRA=
github.com/br0xen/go-todotxt v0.0.0-20190220135311-c2c2ad14ad22/go.mod h1:AmJKSVbee7+0JxWEd/79ButCY9e9NTfSUK+6DY+77Cg=
github.com/br0xen/termbox-util v0.0.0-20170904143325-de1d4c83380e h1:PF4gYXcZfTbAoAk5DPZcvjmq8gyg4gpcmWdT8W+0X1c=
github.com/br0xen/termbox-util v0.0.0-20170904143325-de1d4c83380e/go.mod h1:x9wJlgOj74OFTOBwXOuO8pBguW37EgYNx51Dbjkfzo4=
github.com/br0xen/user-config v0.0.0-20170914134719-16e743ec93a2 h1:H/prDPxUZBsK4DQC7ScP3ftSijMtWyetb6ab69DSKrs=
github.com/br0xen/user-config v0.0.0-20170914134719-16e743ec93a2/go.mod h1:lMy7txIyYXt+I/1JgTGBZTdyTNJyNVDCX4Z+lHzNcSM=
github.com/casimir/xdg-go v0.0.0-20160329195404-372ccc2180da h1:hjpZV7G49m1bly++F+Gho1Sbf2+eBW/eTLJWuRkH9Uc= github.com/casimir/xdg-go v0.0.0-20160329195404-372ccc2180da h1:hjpZV7G49m1bly++F+Gho1Sbf2+eBW/eTLJWuRkH9Uc=
github.com/casimir/xdg-go v0.0.0-20160329195404-372ccc2180da/go.mod h1:dywSSi3sMtJn2IjiYfJciP9tjVVeIVRa7AE7N5WLUBo= github.com/casimir/xdg-go v0.0.0-20160329195404-372ccc2180da/go.mod h1:dywSSi3sMtJn2IjiYfJciP9tjVVeIVRa7AE7N5WLUBo=
github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y= github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d h1:x3S6kxmy49zXVVyhcnrFqxvNVCBPb2KZ9hV2RBdS840= github.com/nsf/termbox-go v1.1.0 h1:R+GIXVMaDxDQ2VHem5vO5h0mI8ZxLECTUNw1ZzXODzI=
github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d/go.mod h1:IuKpRQcYE1Tfu+oAQqaLisqDeXgjyyltCfsaoYN18NQ= github.com/nsf/termbox-go v1.1.0/go.mod h1:T0cTdVuOwf7pHQNtfhnEbzHbcNyCEcVU4YPpouCbVxo=

View File

@ -3,7 +3,7 @@ package main
import ( import (
"time" "time"
"github.com/br0xen/termbox-util" termboxUtil "git.bullercodeworks.com/brian/termbox-util"
termbox "github.com/nsf/termbox-go" termbox "github.com/nsf/termbox-go"
) )

View File

@ -5,7 +5,7 @@ import (
"strings" "strings"
"time" "time"
todotxt "github.com/br0xen/go-todotxt" todotxt "git.bullercodeworks.com/brian/go-todotxt"
) )
// diskListChanged returns true if the task list in todo.txt // diskListChanged returns true if the task list in todo.txt

View File

@ -4,8 +4,8 @@ import (
"fmt" "fmt"
"time" "time"
"github.com/br0xen/termbox-screen" termboxScreen "git.bullercodeworks.com/brian/termbox-screen"
"github.com/br0xen/termbox-util" termboxUtil "git.bullercodeworks.com/brian/termbox-util"
termbox "github.com/nsf/termbox-go" termbox "github.com/nsf/termbox-go"
) )

View File

@ -6,9 +6,9 @@ import (
"strings" "strings"
"time" "time"
todotxt "github.com/br0xen/go-todotxt" todotxt "git.bullercodeworks.com/brian/go-todotxt"
"github.com/br0xen/termbox-screen" termboxScreen "git.bullercodeworks.com/brian/termbox-screen"
"github.com/br0xen/termbox-util" termboxUtil "git.bullercodeworks.com/brian/termbox-util"
termbox "github.com/nsf/termbox-go" termbox "github.com/nsf/termbox-go"
) )

View File

@ -6,9 +6,9 @@ import (
"strings" "strings"
"time" "time"
todotxt "github.com/br0xen/go-todotxt" todotxt "git.bullercodeworks.com/brian/go-todotxt"
"github.com/br0xen/termbox-screen" termboxScreen "git.bullercodeworks.com/brian/termbox-screen"
"github.com/br0xen/termbox-util" termboxUtil "git.bullercodeworks.com/brian/termbox-util"
termbox "github.com/nsf/termbox-go" termbox "github.com/nsf/termbox-go"
) )
@ -89,9 +89,9 @@ func (screen *TaskScreen) HandleKeyEvent(event termbox.Event) int {
} }
if event.Key == termbox.KeyEnter { if event.Key == termbox.KeyEnter {
screen.editing = true screen.editing = true
screen.inputField.SetTitle(screen.fieldLabels[screen.cursor] + ": ") //screen.inputField.SetTitle(screen.fieldLabels[screen.cursor] + ": ")
screen.inputField.SetValue(screen.GetFieldValue(screen.cursor)) screen.inputField.SetValue(screen.GetFieldValue(screen.cursor))
screen.inputField.SetActive(true) //screen.inputField.SetActive(true)
return screen.Id() return screen.Id()
} else if event.Key == termbox.KeyBackspace || event.Key == termbox.KeyBackspace2 || event.Ch == 'h' || event.Key == termbox.KeyArrowLeft { } else if event.Key == termbox.KeyBackspace || event.Key == termbox.KeyBackspace2 || event.Ch == 'h' || event.Key == termbox.KeyArrowLeft {
@ -217,7 +217,7 @@ func (screen *TaskScreen) handleEditingKeyEvent(event termbox.Event) int {
} }
} }
screen.editing = false screen.editing = false
screen.inputField.SetActive(false) //screen.inputField.SetActive(false)
} else { } else {
if screen.inputField.HandleEvent(event) { if screen.inputField.HandleEvent(event) {

View File

@ -5,7 +5,7 @@ import (
"strconv" "strconv"
"strings" "strings"
todotxt "github.com/br0xen/go-todotxt" todotxt "git.bullercodeworks.com/brian/go-todotxt"
) )
func (a *AppState) opListTasks(args []string) int { func (a *AppState) opListTasks(args []string) int {
@ -19,6 +19,9 @@ func (a *AppState) opListTasks(args []string) int {
filterString = strings.Join(args, " ") filterString = strings.Join(args, " ")
a.TaskList = a.getFilteredList(filterString) a.TaskList = a.getFilteredList(filterString)
} }
a.TaskList.Sort(todotxt.SORT_USEFULNESS_ASC)
for _, v := range *a.TaskList { for _, v := range *a.TaskList {
fmt.Println(a.getTaskString(v)) fmt.Println(a.getTaskString(v))
lastIdx++ lastIdx++