mirror of
https://github.com/issadarkthing/gomu.git
synced 2025-05-01 13:48:52 +08:00
clean up
This commit is contained in:
parent
6dfa26c4f3
commit
b422cd25de
16
start.go
16
start.go
@ -52,6 +52,15 @@ func getArgs() Args {
|
|||||||
return ar
|
return ar
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// built-in functions
|
||||||
|
func defineBuiltins() {
|
||||||
|
gomu.anko.Define("debug_popup", debugPopup)
|
||||||
|
gomu.anko.Define("input_popup", inputPopup)
|
||||||
|
gomu.anko.Define("show_popup", defaultTimedPopup)
|
||||||
|
gomu.anko.Define("search_popup", searchPopup)
|
||||||
|
gomu.anko.Define("shell", shell)
|
||||||
|
}
|
||||||
|
|
||||||
// executes user config with default config is executed first in order to apply
|
// executes user config with default config is executed first in order to apply
|
||||||
// default values
|
// default values
|
||||||
func execConfig(config string) error {
|
func execConfig(config string) error {
|
||||||
@ -97,12 +106,6 @@ color_popup = "#0A0F14"
|
|||||||
// vim: syntax=go
|
// vim: syntax=go
|
||||||
`
|
`
|
||||||
|
|
||||||
// built-in functions
|
|
||||||
gomu.anko.Define("debug_popup", debugPopup)
|
|
||||||
gomu.anko.Define("input_popup", inputPopup)
|
|
||||||
gomu.anko.Define("show_popup", defaultTimedPopup)
|
|
||||||
gomu.anko.Define("search_popup", searchPopup)
|
|
||||||
gomu.anko.Define("shell", shell)
|
|
||||||
|
|
||||||
cfg := expandTilde(config)
|
cfg := expandTilde(config)
|
||||||
|
|
||||||
@ -157,6 +160,7 @@ func start(application *tview.Application, args Args) {
|
|||||||
// Assigning to global variable gomu
|
// Assigning to global variable gomu
|
||||||
gomu = newGomu()
|
gomu = newGomu()
|
||||||
gomu.command.defineCommands()
|
gomu.command.defineCommands()
|
||||||
|
defineBuiltins()
|
||||||
err := execConfig(expandFilePath(*args.config))
|
err := execConfig(expandFilePath(*args.config))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
die(err)
|
die(err)
|
||||||
|
@ -61,11 +61,8 @@ module Keybinds {
|
|||||||
v = func() {
|
v = func() {
|
||||||
input_popup("fib calculator", func(result) {
|
input_popup("fib calculator", func(result) {
|
||||||
x = to_int(result)
|
x = to_int(result)
|
||||||
|
result = fib(x)
|
||||||
go func() {
|
debug_popup(to_string(result))
|
||||||
result = fib(x)
|
|
||||||
debug_popup(to_string(result))
|
|
||||||
}()
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user