about summary refs log tree commit diff stats
path: root/src/io/buffer.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-11-05 15:48:27 +0100
committerbptato <nincsnevem662@gmail.com>2022-11-09 15:05:23 +0100
commitc2df7d47b151be732542cc3ff37817762e87bcb8 (patch)
tree1a28d912a181fe9544e6d797573ea22052bc4172 /src/io/buffer.nim
parentf3f13da82686c73e5593e3ba3362b2470bd215bc (diff)
downloadchawan-c2df7d47b151be732542cc3ff37817762e87bcb8.tar.gz
Use separate FileLoader instance for each buffer
Diffstat (limited to 'src/io/buffer.nim')
-rw-r--r--src/io/buffer.nim7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/io/buffer.nim b/src/io/buffer.nim
index 8bfd6d16..f4cce8c4 100644
--- a/src/io/buffer.nim
+++ b/src/io/buffer.nim
@@ -72,14 +72,13 @@ type
     config*: Config
     tty: File
 
-proc newBuffer*(config: Config, loader: FileLoader, tty: File): Buffer =
+proc newBuffer*(config: Config, tty: File): Buffer =
   new(result)
   result.attrs = getTermAttributes(stdout)
   result.width = result.attrs.width
   result.height = result.attrs.height - 1
   result.config = config
-  result.loader = loader
-  result.tty = tty
+  result.loader = newFileLoader()
 
   result.display = newFixedGrid(result.width, result.height)
   result.prevdisplay = newFixedGrid(result.width, result.height)
@@ -1216,7 +1215,7 @@ proc setupBuffer*(buffer: Buffer) =
   buffer.redraw = true
 
 proc dupeBuffer*(buffer: Buffer, location = none(URL)): Buffer =
-  let clone = newBuffer(buffer.config, buffer.loader, buffer.tty)
+  let clone = newBuffer(buffer.config, buffer.tty)
   clone.contenttype = buffer.contenttype
   clone.ispipe = buffer.ispipe
   if location.isSome: