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 <christopher.waldon.dev@gmail.com>
This commit is contained in:
Chris Waldon
2022-02-24 20:54:16 -05:00
committed by Elias Naur
parent 7f90f04c07
commit a7afa4d6d1
+1 -1
View File
@@ -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.