mirror of
https://github.com/issadarkthing/gomu.git
synced 2025-04-26 13:49:21 +08:00
capitalize module
This commit is contained in:
parent
7f3b33621c
commit
cf54af8d74
@ -91,7 +91,7 @@ func (a *Anko) Execute(src string) (interface{}, error) {
|
||||
|
||||
// KeybindExists checks if keybinding is defined.
|
||||
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)
|
||||
if err != nil {
|
||||
return false
|
||||
@ -102,7 +102,7 @@ func (a *Anko) KeybindExists(panel string, keybind string) bool {
|
||||
|
||||
// ExecKeybind executes function bounded by the keybinding.
|
||||
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)
|
||||
return err
|
||||
}
|
||||
|
@ -149,9 +149,9 @@ func newPlaylist(args Args) *Playlist {
|
||||
|
||||
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 {
|
||||
errorPopup(err)
|
||||
}
|
||||
|
4
queue.go
4
queue.go
@ -372,9 +372,9 @@ func newQueue() *Queue {
|
||||
queue.SetInputCapture(func(e *tcell.EventKey) *tcell.EventKey {
|
||||
|
||||
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 {
|
||||
errorPopup(err)
|
||||
}
|
||||
|
4
start.go
4
start.go
@ -232,9 +232,9 @@ func start(application *tview.Application, args Args) {
|
||||
}
|
||||
|
||||
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 {
|
||||
errorPopup(err)
|
||||
}
|
||||
|
@ -37,9 +37,9 @@ color_popup = "#0A0F14"
|
||||
|
||||
|
||||
|
||||
module keybinds {
|
||||
module Keybinds {
|
||||
|
||||
module global {
|
||||
module Global {
|
||||
|
||||
b = func () {
|
||||
# execute shell function and capture stdout and stderr
|
||||
@ -63,7 +63,7 @@ module keybinds {
|
||||
}
|
||||
|
||||
|
||||
module playlist {
|
||||
module Playlist {
|
||||
e = func() {
|
||||
val = 10 + 10
|
||||
debug_popup(to_string(val))
|
||||
@ -76,7 +76,7 @@ module keybinds {
|
||||
}
|
||||
}
|
||||
|
||||
module queue {
|
||||
module Queue {
|
||||
# override default loop keybinding
|
||||
o = toggle_loop
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user