From a7afa4d6d19ae25ed9de17067df1ef26c765e352 Mon Sep 17 00:00:00 2001 From: Chris Waldon Date: Thu, 24 Feb 2022 20:54:16 -0500 Subject: [PATCH] widget: fix editor's io.Seeker implementation For some reason, widget.Editor had a Seek method that ignored the supplied offset and always seeked to offset zero. This made it impossible to use it like any other io.Seeker. This commit simply honors the requested offset. Signed-off-by: Chris Waldon --- widget/editor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/widget/editor.go b/widget/editor.go index 90433ff2..3c958a73 100644 --- a/widget/editor.go +++ b/widget/editor.go @@ -1349,7 +1349,7 @@ func (e *Editor) WriteTo(w io.Writer) (int64, error) { // Seek implements io.Seeker. func (e *Editor) Seek(offset int64, whence int) (int64, error) { - return e.rr.Seek(0, io.SeekStart) + return e.rr.Seek(offset, io.SeekStart) } // Read implements io.Reader.