diff options
author | Petter Rodhelind <petter.rodhelind@gmail.com> | 2018-02-25 10:46:59 +0100 |
---|---|---|
committer | Petter Rodhelind <petter.rodhelind@gmail.com> | 2018-02-25 10:46:59 +0100 |
commit | 0e86accb588445f09b07ec68e6cc62903f9ba7bd (patch) | |
tree | 4bd67a8acb1a41039fceaa126fb5180ffa6e6770 /text.go | |
parent | 1c1469d5522c7c7d7c03232d9c2711c5d96d3c18 (diff) | |
download | poe-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.go | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -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) |