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:
parent
62c9e3892a
commit
a92af549fe
@ -1,7 +1,6 @@
|
|||||||
package todo
|
package todo
|
||||||
|
|
||||||
import (
|
import ()
|
||||||
)
|
|
||||||
|
|
||||||
type Item struct {
|
type Item struct {
|
||||||
Checked bool
|
Checked bool
|
||||||
@ -11,7 +10,7 @@ type Item struct {
|
|||||||
|
|
||||||
func (item *Item) CheckMark() string {
|
func (item *Item) CheckMark() string {
|
||||||
if item.Checked {
|
if item.Checked {
|
||||||
return "x"
|
return Config.UString("wtf.mods.todo.checkedIcon", "x")
|
||||||
} else {
|
} else {
|
||||||
return " "
|
return " "
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package todo
|
package todo
|
||||||
|
|
||||||
import ("fmt")
|
import (
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
type List struct {
|
type List struct {
|
||||||
Items []*Item
|
Items []*Item
|
||||||
@ -63,7 +65,7 @@ func (list *List) Len() int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (list *List) Less(i, j int) bool {
|
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) {
|
func (list *List) Swap(i, j int) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user