about summary refs log tree commit diff stats
path: root/src/io/buffer.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-10-04 12:13:27 +0200
committerbptato <nincsnevem662@gmail.com>2022-10-04 12:13:27 +0200
commitc4e2de9cd8cad7e28b33e68b1b76f9044fe510be (patch)
tree92930e716d3c1ffca8614c030a35c5008655bca4 /src/io/buffer.nim
parent10d3154eff79ce53b82fa946556f52f3e10eac90 (diff)
downloadchawan-c4e2de9cd8cad7e28b33e68b1b76f9044fe510be.tar.gz
WIP pager
Diffstat (limited to 'src/io/buffer.nim')
-rw-r--r--src/io/buffer.nim11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/io/buffer.nim b/src/io/buffer.nim
index 8b1268ef..b5e46297 100644
--- a/src/io/buffer.nim
+++ b/src/io/buffer.nim
@@ -8,6 +8,7 @@ import unicode
 
 import css/sheet
 import css/stylednode
+import config/config
 import html/dom
 import html/tags
 import html/htmlparser
@@ -67,8 +68,8 @@ type
     next*: Buffer
     userstyle*: CSSStylesheet
     loader*: FileLoader
-    markcolor*: CellColor
     marks*: seq[Mark]
+    config*: Config
 
 proc newBuffer*(): Buffer =
   new(result)
@@ -713,7 +714,7 @@ proc gotoAnchor*(buffer: Buffer) =
 proc addMark*(buffer: Buffer, x, y, width: int): Mark =
   assert y < buffer.lines.len
   var format = newFormat()
-  format.bgcolor = buffer.markcolor
+  format.bgcolor = buffer.config.markcolor
   result = Mark(x: x, y: y, width: width, format: format)
   let previ = upperBound(buffer.marks, y, (proc(a: Mark, b: int): int = cmp(a.y, b)))
   buffer.marks.insert(result, previ)
@@ -1139,7 +1140,7 @@ proc click*(buffer: Buffer): Option[Request] =
         var value = input.value
         print(HVP(buffer.height + 1, 1))
         print(EL())
-        let status = readLine("SEARCH: ", value, buffer.width, {'\r', '\n'})
+        let status = readLine("SEARCH: ", value, buffer.width, {'\r', '\n'}, config = buffer.config)
         if status:
           input.value = value
           input.invalid = true
@@ -1151,7 +1152,7 @@ proc click*(buffer: Buffer): Option[Request] =
         var value = input.value
         print(HVP(buffer.height + 1, 1))
         print(EL())
-        let status = readLine("TEXT: ", value, buffer.width, {'\r', '\n'}, input.inputType == INPUT_PASSWORD)
+        let status = readLine("TEXT: ", value, buffer.width, {'\r', '\n'}, input.inputType == INPUT_PASSWORD, config = buffer.config)
         if status:
           input.value = value
           input.invalid = true
@@ -1163,7 +1164,7 @@ proc click*(buffer: Buffer): Option[Request] =
           ""
         print(HVP(buffer.height + 1, 1))
         print(EL())
-        let status = readLine("Filename: ", path, buffer.width, {'\r', '\n'})
+        let status = readLine("Filename: ", path, buffer.width, {'\r', '\n'}, config = buffer.config)
         if status:
           let cdir = parseUrl("file://" & getCurrentDir() & DirSep)
           let path = parseUrl(path, cdir)