diff --git a/main.go b/main.go index 06871a9..6de81c1 100644 --- a/main.go +++ b/main.go @@ -16,6 +16,7 @@ import ( ) var path = flag.String("path", ".", "library path") +var editor = flag.String("editor", os.Getenv("EDITOR"), "editor") func init() { flag.Parse() @@ -99,7 +100,7 @@ func main() { bopt := menu.Option{ Name: book.String(), Action: menu.ActionExec, - Args: []string{os.Getenv("EDITOR"), book.Path}, + Args: []string{*editor, book.Path}, } bookopts = append(bookopts, bopt) } diff --git a/pkg/menu/menu_view.go b/pkg/menu/menu_view.go index 2cb42ca..0c497f7 100644 --- a/pkg/menu/menu_view.go +++ b/pkg/menu/menu_view.go @@ -49,6 +49,12 @@ func (mv *MenuView) HandleEvent(e tcell.Event) bool { case tcell.KeyDown, tcell.KeyCtrlN: mv.keyDown() return true + case tcell.KeyLeft: + mv.keyBack() + return true + case tcell.KeyRight: + mv.keyEnter() + return true case tcell.KeyPgDn, tcell.KeyCtrlF: mv.keyPgDn() return true diff --git a/pkg/tal/repo.go b/pkg/tal/repo.go index cf0cbf2..462e402 100644 --- a/pkg/tal/repo.go +++ b/pkg/tal/repo.go @@ -24,6 +24,9 @@ type Repo struct { func (lr *Repo) GetMeta() map[string]map[string][]Book { meta := map[string]map[string][]Book{} for _, book := range lr.Books { + if book.Meta["DELETED"] != "" { + continue + } for key, value := range book.Meta { if meta[key] == nil { meta[key] = map[string][]Book{}