mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-24 17:50:15 +09:00
Add onBufferOpen plugin callback
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user