about summary refs log tree commit diff stats
path: root/src/local
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-03-12 16:08:48 +0100
committerbptato <nincsnevem662@gmail.com>2024-03-12 16:08:48 +0100
commit73311e5698a8fd53dc6b18e20d02b93e2b2ac487 (patch)
tree47c9ab3746a27e520cec6b03815de8c6cc05eb49 /src/local
parent0ce77eeb07b40f1c664308b7029474d52142afe8 (diff)
downloadchawan-73311e5698a8fd53dc6b18e20d02b93e2b2ac487.tar.gz
posixstream: do not ignore lseek result
Diffstat (limited to 'src/local')
-rw-r--r--src/local/container.nim8
1 files changed, 6 insertions, 2 deletions
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")