aboutsummaryrefslogtreecommitdiff
path: root/text.go
diff options
context:
space:
mode:
authorPetter Rodhelind <petter.rodhelind@gmail.com>2018-02-25 10:46:59 +0100
committerPetter Rodhelind <petter.rodhelind@gmail.com>2018-02-25 10:46:59 +0100
commit0e86accb588445f09b07ec68e6cc62903f9ba7bd (patch)
tree4bd67a8acb1a41039fceaa126fb5180ffa6e6770 /text.go
parent1c1469d5522c7c7d7c03232d9c2711c5d96d3c18 (diff)
downloadpoe-0e86accb588445f09b07ec68e6cc62903f9ba7bd.tar.gz
poe-0e86accb588445f09b07ec68e6cc62903f9ba7bd.tar.bz2
poe-0e86accb588445f09b07ec68e6cc62903f9ba7bd.zip
Add alternative mouse clicks for one-btn-only laptops, fix scroll and add "save buffer with a new name".
Diffstat (limited to 'text.go')
-rw-r--r--text.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/text.go b/text.go
index b9398ed..fb4090a 100644
--- a/text.go
+++ b/text.go
@@ -82,9 +82,6 @@ func (t *Text) String() string {
// ReadRune reads a rune from buffer and advances the internal offset. This could be called in sequence to get all runes from buffer. This populates LastRune().
func (t *Text) ReadRune() (r rune, size int, err error) {
r, size, err = t.ReadRuneAt(t.off)
- if err != nil {
- return 0, 0, err
- }
t.off += size
t.lastRune = r
return
@@ -96,7 +93,7 @@ func (t *Text) UnreadRune() (r rune, size int, err error) {
r, size, err = t.ReadRuneAt(t.off)
t.off++
if err != nil {
- return 0, 0, err
+ return
}
t.off -= size
return
@@ -104,7 +101,7 @@ func (t *Text) UnreadRune() (r rune, size int, err error) {
// ReadRuneAt returns the rune and its size at offset. If the given offset (in byte count) is not a valid rune, it will try to back up until it finds a valid starting point for a rune and return that one.
//
-// This is basically a Seek(offset) followed by a ReadRune(), but does not affect the internal offset for future reads..
+// This is basically a Seek(offset) followed by a ReadRune(), but does not affect the internal offset for future reads.
func (t *Text) ReadRuneAt(offset int) (r rune, size int, err error) {
var c byte
c, err = t.buf.ByteAt(offset)