tweaks
This commit is contained in:
parent
5d4716746c
commit
4f9683689b
3
main.go
3
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)
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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{}
|
||||
|
Loading…
Reference in New Issue
Block a user