From 59463d22ff060393d515188dcd615b5a1808b95f Mon Sep 17 00:00:00 2001 From: Hossein Mehrabi Date: Sat, 2 Jun 2018 10:49:51 +0430 Subject: [PATCH] clean up todo list --- todo/list.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/todo/list.go b/todo/list.go index 6ad3f1ec..0e852f6c 100644 --- a/todo/list.go +++ b/todo/list.go @@ -1,7 +1,5 @@ package todo -import () - type List struct { Items []*Item @@ -33,10 +31,7 @@ func (list *List) CheckedItems() []*Item { func (list *List) Delete() { list.Items = append(list.Items[:list.selected], list.Items[list.selected+1:]...) - - if list.selected >= len(list.Items) { - list.selected-- - } + list.Prev() } func (list *List) Demote() {