Load plugins from ~/.config/micro/plugins

This commit is contained in:
Zachary Yedidia
2016-04-26 16:20:26 -04:00
parent eba820a9c7
commit 603cec9d81
4 changed files with 36 additions and 41 deletions

View File

@@ -620,14 +620,15 @@ func (v *View) Save() bool {
v.GoSave()
}
}
if err := L.CallByParam(lua.P{
Fn: L.GetGlobal("onSave"),
NRet: 0,
Protect: true,
}); err != nil {
// The function isn't defined by this plugin
messenger.Error(err)
return true
for _, pl := range loadedPlugins {
if err := L.CallByParam(lua.P{
Fn: L.GetGlobal(pl + "_onSave"),
NRet: 0,
Protect: true,
}); err != nil {
// The function isn't defined by this plugin
messenger.Error(err)
}
}
return true
}