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 path = flag.String("path", ".", "library path")
|
||||||
|
var editor = flag.String("editor", os.Getenv("EDITOR"), "editor")
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
@ -99,7 +100,7 @@ func main() {
|
|||||||
bopt := menu.Option{
|
bopt := menu.Option{
|
||||||
Name: book.String(),
|
Name: book.String(),
|
||||||
Action: menu.ActionExec,
|
Action: menu.ActionExec,
|
||||||
Args: []string{os.Getenv("EDITOR"), book.Path},
|
Args: []string{*editor, book.Path},
|
||||||
}
|
}
|
||||||
bookopts = append(bookopts, bopt)
|
bookopts = append(bookopts, bopt)
|
||||||
}
|
}
|
||||||
|
@ -49,6 +49,12 @@ func (mv *MenuView) HandleEvent(e tcell.Event) bool {
|
|||||||
case tcell.KeyDown, tcell.KeyCtrlN:
|
case tcell.KeyDown, tcell.KeyCtrlN:
|
||||||
mv.keyDown()
|
mv.keyDown()
|
||||||
return true
|
return true
|
||||||
|
case tcell.KeyLeft:
|
||||||
|
mv.keyBack()
|
||||||
|
return true
|
||||||
|
case tcell.KeyRight:
|
||||||
|
mv.keyEnter()
|
||||||
|
return true
|
||||||
case tcell.KeyPgDn, tcell.KeyCtrlF:
|
case tcell.KeyPgDn, tcell.KeyCtrlF:
|
||||||
mv.keyPgDn()
|
mv.keyPgDn()
|
||||||
return true
|
return true
|
||||||
|
@ -24,6 +24,9 @@ type Repo struct {
|
|||||||
func (lr *Repo) GetMeta() map[string]map[string][]Book {
|
func (lr *Repo) GetMeta() map[string]map[string][]Book {
|
||||||
meta := map[string]map[string][]Book{}
|
meta := map[string]map[string][]Book{}
|
||||||
for _, book := range lr.Books {
|
for _, book := range lr.Books {
|
||||||
|
if book.Meta["DELETED"] != "" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
for key, value := range book.Meta {
|
for key, value := range book.Meta {
|
||||||
if meta[key] == nil {
|
if meta[key] == nil {
|
||||||
meta[key] = map[string][]Book{}
|
meta[key] = map[string][]Book{}
|
||||||
|
Loading…
Reference in New Issue
Block a user