1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Remove the Index prop from Todo#Item. Don't need it

This commit is contained in:
Chris Cummer 2018-04-23 10:18:33 -07:00
parent 62c9e3892a
commit a92af549fe
2 changed files with 6 additions and 5 deletions

View File

@ -1,7 +1,6 @@
package todo
import (
)
import ()
type Item struct {
Checked bool
@ -11,7 +10,7 @@ type Item struct {
func (item *Item) CheckMark() string {
if item.Checked {
return "x"
return Config.UString("wtf.mods.todo.checkedIcon", "x")
} else {
return " "
}

View File

@ -1,6 +1,8 @@
package todo
import ("fmt")
import (
"fmt"
)
type List struct {
Items []*Item
@ -63,7 +65,7 @@ func (list *List) Len() int {
}
func (list *List) Less(i, j int) bool {
return list.Items[i].Index < list.Items[j].Index
return list.Items[i].Text < list.Items[j].Text
}
func (list *List) Swap(i, j int) {