about summary refs log tree commit diff stats
path: root/src/buffer
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-12-15 18:59:18 +0100
committerbptato <nincsnevem662@gmail.com>2022-12-15 18:59:18 +0100
commitf0de405c6614356928d8700e2e95d00d97ffe2f9 (patch)
tree09c20a94ad68c9cf9a53084925a52fc93279d03c /src/buffer
parent4cd5832ec1bfd02e8afdf5777546cadbe5eaaafb (diff)
downloadchawan-f0de405c6614356928d8700e2e95d00d97ffe2f9.tar.gz
Fix console display bugs, add container.location
Diffstat (limited to 'src/buffer')
-rw-r--r--src/buffer/container.nim5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/buffer/container.nim b/src/buffer/container.nim
index 7a3534be..85c3b9e8 100644
--- a/src/buffer/container.nim
+++ b/src/buffer/container.nim
@@ -115,6 +115,9 @@ proc newBuffer*(dispatcher: Dispatcher, config: BufferConfig,
   istream.sread(result.process)
   result.pos.setx = -1
 
+func location*(container: Container): URL {.jsfunc.} =
+  container.source.location
+
 func lineLoaded(container: Container, y: int): bool =
   return y - container.lineshift in 0..container.lines.high
 
@@ -271,7 +274,7 @@ proc setNumLines(container: Container, lines: int, finish = false) =
     container.updateCursor()
     container.triggerEvent(STATUS)
 
-proc requestLines*(container: Container, w = container.lineWindow) =
+proc requestLines*(container: Container, w = container.lineWindow): auto {.discardable.} =
   container.iface.getLines(w).then(proc(res: tuple[numLines: int, lines: seq[SimpleFlexibleLine]]) =
     container.lines.setLen(w.len)
     container.lineshift = w.a