mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-30 06:37:14 +09:00
Fix multi buffer same file cursors
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -233,6 +232,16 @@ func (b *Buffer) SetName(s string) {
|
|||||||
b.name = s
|
b.name = s
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (b *Buffer) Insert(start Loc, text string) {
|
||||||
|
b.EventHandler.cursors = b.cursors
|
||||||
|
b.EventHandler.Insert(start, text)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (b *Buffer) Remove(start, end Loc) {
|
||||||
|
b.EventHandler.cursors = b.cursors
|
||||||
|
b.EventHandler.Remove(start, end)
|
||||||
|
}
|
||||||
|
|
||||||
// FileType returns the buffer's filetype
|
// FileType returns the buffer's filetype
|
||||||
func (b *Buffer) FileType() string {
|
func (b *Buffer) FileType() string {
|
||||||
return b.Settings["filetype"].(string)
|
return b.Settings["filetype"].(string)
|
||||||
@@ -415,8 +424,6 @@ func (b *Buffer) SetCursors(c []*Cursor) {
|
|||||||
// AddCursor adds a new cursor to the list
|
// AddCursor adds a new cursor to the list
|
||||||
func (b *Buffer) AddCursor(c *Cursor) {
|
func (b *Buffer) AddCursor(c *Cursor) {
|
||||||
b.cursors = append(b.cursors, c)
|
b.cursors = append(b.cursors, c)
|
||||||
b.EventHandler.cursors = b.cursors
|
|
||||||
log.Println(b.cursors)
|
|
||||||
b.UpdateCursors()
|
b.UpdateCursors()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user