Type BufType
}
-// The SerializedBuffer holds the types that get serialized when a buffer is saved
-// These are used for the savecursor and saveundo options
-type SerializedBuffer struct {
- EventHandler *EventHandler
- Cursor Loc
- ModTime time.Time
-}
-
// NewBufferFromFile opens a new buffer using the given path
// It will also automatically handle `~`, and line/column with filename:l:c
// It will return an empty buffer if the path does not exist
h.Sum((*out)[:0])
}
+func (b *Buffer) insert(pos Loc, value []byte) {
+ b.isModified = true
+ b.LineArray.insert(pos, value)
+}
+func (b *Buffer) remove(start, end Loc) []byte {
+ b.isModified = true
+ sub := b.LineArray.remove(start, end)
+ return sub
+}
+func (b *Buffer) deleteToEnd(start Loc) {
+ b.isModified = true
+ b.LineArray.deleteToEnd(start)
+}
+
// UpdateRules updates the syntax rules and filetype for this buffer
// This is called when the colorscheme changes
func (b *Buffer) UpdateRules() {