mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
widget: fix editBuffer.WriteTo for short writes
Noticed while working in the area. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+1
-1
@@ -161,7 +161,7 @@ func (e *editBuffer) ReadRune() (rune, int, error) {
|
||||
// WriteTo implements io.WriterTo.
|
||||
func (e *editBuffer) WriteTo(w io.Writer) (int64, error) {
|
||||
n1, err := w.Write(e.text[:e.gapstart])
|
||||
if err != nil {
|
||||
if err != nil || n1 < e.gapstart {
|
||||
return int64(n1), err
|
||||
}
|
||||
n2, err := w.Write(e.text[e.gapend:])
|
||||
|
||||
Reference in New Issue
Block a user