Add onBufferOpen plugin callback

This commit is contained in:
Zachary Yedidia
2016-08-24 17:03:02 -07:00
parent dbdfef632e
commit 0711c29c0a
4 changed files with 21 additions and 9 deletions

View File

@@ -8,6 +8,7 @@ import (
"os/exec"
"os/signal"
"path/filepath"
"strings"
"time"
"unicode/utf8"
)
@@ -114,6 +115,11 @@ func NewBuffer(txt []byte, path string) *Buffer {
file.Close()
}
_, err := Call("onBufferOpen", b)
if err != nil && !strings.HasPrefix(err.Error(), "function does not exist") {
TermMessage(err)
}
return b
}