capitalize module

This commit is contained in:
raziman 2021-02-15 14:27:45 +08:00
parent 7f3b33621c
commit cf54af8d74
5 changed files with 12 additions and 12 deletions

View File

@ -91,7 +91,7 @@ func (a *Anko) Execute(src string) (interface{}, error) {
// KeybindExists checks if keybinding is defined. // KeybindExists checks if keybinding is defined.
func (a *Anko) KeybindExists(panel string, keybind string) bool { func (a *Anko) KeybindExists(panel string, keybind string) bool {
src := fmt.Sprintf("keybinds.%s.%s", panel, keybind) src := fmt.Sprintf("Keybinds.%s.%s", panel, keybind)
val, err := a.Execute(src) val, err := a.Execute(src)
if err != nil { if err != nil {
return false return false
@ -102,7 +102,7 @@ func (a *Anko) KeybindExists(panel string, keybind string) bool {
// ExecKeybind executes function bounded by the keybinding. // ExecKeybind executes function bounded by the keybinding.
func (a *Anko) ExecKeybind(panel string, keybind string) error { func (a *Anko) ExecKeybind(panel string, keybind string) error {
src := fmt.Sprintf("keybinds.%s.%s()", panel, keybind) src := fmt.Sprintf("Keybinds.%s.%s()", panel, keybind)
_, err := a.Execute(src) _, err := a.Execute(src)
return err return err
} }

View File

@ -149,9 +149,9 @@ func newPlaylist(args Args) *Playlist {
kb := string(e.Rune()) kb := string(e.Rune())
if gomu.anko.KeybindExists("playlist", kb) { if gomu.anko.KeybindExists("Playlist", kb) {
err := gomu.anko.ExecKeybind("playlist", kb) err := gomu.anko.ExecKeybind("Playlist", kb)
if err != nil { if err != nil {
errorPopup(err) errorPopup(err)
} }

View File

@ -372,9 +372,9 @@ func newQueue() *Queue {
queue.SetInputCapture(func(e *tcell.EventKey) *tcell.EventKey { queue.SetInputCapture(func(e *tcell.EventKey) *tcell.EventKey {
keybind := string(e.Rune()) keybind := string(e.Rune())
if gomu.anko.KeybindExists("queue", keybind) { if gomu.anko.KeybindExists("Queue", keybind) {
err := gomu.anko.ExecKeybind("queue", keybind) err := gomu.anko.ExecKeybind("Queue", keybind)
if err != nil { if err != nil {
errorPopup(err) errorPopup(err)
} }

View File

@ -232,9 +232,9 @@ func start(application *tview.Application, args Args) {
} }
kb := string(e.Rune()) kb := string(e.Rune())
if gomu.anko.KeybindExists("global", kb) { if gomu.anko.KeybindExists("Global", kb) {
err := gomu.anko.ExecKeybind("global", kb) err := gomu.anko.ExecKeybind("Global", kb)
if err != nil { if err != nil {
errorPopup(err) errorPopup(err)
} }

View File

@ -37,9 +37,9 @@ color_popup = "#0A0F14"
module keybinds { module Keybinds {
module global { module Global {
b = func () { b = func () {
# execute shell function and capture stdout and stderr # execute shell function and capture stdout and stderr
@ -63,7 +63,7 @@ module keybinds {
} }
module playlist { module Playlist {
e = func() { e = func() {
val = 10 + 10 val = 10 + 10
debug_popup(to_string(val)) debug_popup(to_string(val))
@ -76,7 +76,7 @@ module keybinds {
} }
} }
module queue { module Queue {
# override default loop keybinding # override default loop keybinding
o = toggle_loop o = toggle_loop
} }