Add ability to bind lua functions defined in plugins

This commit is contained in:
Zachary Yedidia
2016-05-30 09:12:04 -04:00
parent e3e50dd6f6
commit 68189fd406
4 changed files with 47 additions and 24 deletions

View File

@@ -302,7 +302,7 @@ func (v *View) HandleEvent(event tcell.Event) {
for _, pl := range loadedPlugins {
funcName := strings.Split(runtime.FuncForPC(reflect.ValueOf(action).Pointer()).Name(), ".")
err := Call(pl + "_on" + funcName[len(funcName)-1])
if err != nil {
if err != nil && !strings.HasPrefix(err.Error(), "function does not exist") {
TermMessage(err)
}
}