diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/io/posixstream.nim | 3 | ||||
-rw-r--r-- | src/local/container.nim | 8 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/io/posixstream.nim b/src/io/posixstream.nim index baf3238c..911f384b 100644 --- a/src/io/posixstream.nim +++ b/src/io/posixstream.nim @@ -70,7 +70,8 @@ method setBlocking*(s: PosixStream, blocking: bool) {.base.} = discard fcntl(s.fd, F_SETFL, ofl or O_NONBLOCK) method seek*(s: PosixStream; off: int) = - discard lseek(s.fd, Off(off), SEEK_SET) + if lseek(s.fd, Off(off), SEEK_SET) == -1: + raisePosixIOError() method sclose*(s: PosixStream) = discard close(s.fd) diff --git a/src/local/container.nim b/src/local/container.nim index 9b26f9e5..49d8885e 100644 --- a/src/local/container.nim +++ b/src/local/container.nim @@ -1347,7 +1347,7 @@ proc onload*(container: Container, res: int) = elif res == -1: container.loadState = lsLoaded container.setLoadInfo("") - container.needslines = true + container.triggerEvent(cetStatus) container.triggerEvent(cetLoaded) container.iface.getTitle().then(proc(title: string) = if title != "": @@ -1355,11 +1355,15 @@ proc onload*(container: Container, res: int) = container.triggerEvent(cetTitle) ) if not container.hasstart and container.url.anchor != "": - container.iface.gotoAnchor().then(proc(res: Opt[tuple[x, y: int]]) = + container.requestLines().then(proc(): Promise[Opt[tuple[x, y: int]]] = + return container.iface.gotoAnchor() + ).then(proc(res: Opt[tuple[x, y: int]]) = if res.isSome: let res = res.get container.setCursorXYCenter(res.x, res.y) ) + else: + container.needslines = true else: container.needslines = true container.setLoadInfo(convertSize(res) & " loaded") |