refactor(plugin): Enable human-friendly plugin name

This commit is contained in:
Thomas LE ROUX
2016-12-12 16:37:48 +01:00
parent 63f18f033c
commit 651cb89948
7 changed files with 46 additions and 37 deletions

View File

@@ -120,7 +120,7 @@ func NewViewWidthHeight(buf *Buffer, w, h int) *View {
v.Height--
}
for _, pl := range loadedPlugins {
for pl := range loadedPlugins {
_, err := Call(pl+".onViewOpen", v)
if err != nil && !strings.HasPrefix(err.Error(), "function does not exist") {
TermMessage(err)
@@ -487,7 +487,7 @@ func (v *View) HandleEvent(event tcell.Event) {
v.Buf.Insert(v.Cursor.Loc, string(e.Rune()))
v.Cursor.Right()
for _, pl := range loadedPlugins {
for pl := range loadedPlugins {
_, err := Call(pl+".onRune", string(e.Rune()), v)
if err != nil && !strings.HasPrefix(err.Error(), "function does not exist") {
TermMessage(err)