Autoclose plugin support

This commit is contained in:
Zachary Yedidia
2019-08-02 14:48:59 -07:00
parent a47e1f0ca5
commit e3ae38e54a
8 changed files with 179 additions and 1096 deletions

View File

@@ -6,6 +6,7 @@ import (
"errors"
"io"
"io/ioutil"
"log"
"os"
"path/filepath"
"strconv"
@@ -293,6 +294,7 @@ func (b *Buffer) SetName(s string) {
func (b *Buffer) Insert(start Loc, text string) {
if !b.Type.Readonly {
log.Println("INSERT", start, text)
b.EventHandler.cursors = b.cursors
b.EventHandler.active = b.curCursor
b.EventHandler.Insert(start, text)
@@ -747,3 +749,7 @@ func ParseCursorLocation(cursorPositions []string) (Loc, error) {
return startpos, err
}
func (b *Buffer) Line(i int) string {
return string(b.LineBytes(i))
}