mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
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:
+1
-1
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user