diff options
author | Petter Rodhelind <petter.rodhelind@gmail.com> | 2021-03-04 09:02:14 +0100 |
---|---|---|
committer | Petter Rodhelind <petter.rodhelind@gmail.com> | 2021-03-04 09:02:14 +0100 |
commit | 41009a3bbf367bab2bb6140ed0d71860be4e998b (patch) | |
tree | 55f2b968f1c600fd833f40bce18c0ddb13f9b408 /editor/buffer.go | |
parent | 93f7f1c5c0cbb074109b2681bd78b09b6efb3bb4 (diff) | |
download | poe-41009a3bbf367bab2bb6140ed0d71860be4e998b.tar.gz poe-41009a3bbf367bab2bb6140ed0d71860be4e998b.tar.bz2 poe-41009a3bbf367bab2bb6140ed0d71860be4e998b.zip |
Add Get command to reload buffer from disk.
Diffstat (limited to 'editor/buffer.go')
-rw-r--r-- | editor/buffer.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/editor/buffer.go b/editor/buffer.go index 54ac23e..503cf02 100644 --- a/editor/buffer.go +++ b/editor/buffer.go @@ -246,6 +246,14 @@ func (b *Buffer) Delete() (int, error) { return n, nil } +// Destroy will mark the buffer as completely empty and reset to 0. +func (b *Buffer) Destroy() { + b.buf.Destroy() + b.SetDot(0, 0) + b.dirty = false + b.file.read = false +} + // Len returns the number of bytes in buffer. func (b *Buffer) Len() int { b.initBuffer() |