about summary refs log tree commit diff stats
path: root/src/buffer
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-12-10 22:50:23 +0100
committerbptato <nincsnevem662@gmail.com>2022-12-10 22:50:23 +0100
commit940325abfc9714b06de920a2a7f8911eae22f357 (patch)
tree9651d5f1d22e3eaa6b098b6bbed97a583244375d /src/buffer
parent5c267ce6c9c1add997767f5eaad248cdd829c6fc (diff)
downloadchawan-940325abfc9714b06de920a2a7f8911eae22f357.tar.gz
Fix blocking socketstream recv/send, clean up ips/serialize & types/color
Write always blocks for now, as it's too big of a footgun not to
Diffstat (limited to 'src/buffer')
-rw-r--r--src/buffer/cell.nim8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/buffer/cell.nim b/src/buffer/cell.nim
index d7de064f..a5e33645 100644
--- a/src/buffer/cell.nim
+++ b/src/buffer/cell.nim
@@ -190,7 +190,7 @@ proc handleAnsiCode(format: var Format, final: char, params: string) =
           of 25: format.blink = false
           of 27: format.reverse = false
           of 29: format.strike = false
-          of 30..37: format.fgcolor = CellColor(rgb: false, color: uint8(ip[pi]))
+          of 30..37: format.fgcolor = uint8(ip[pi]).cellColor()
           of 38:
             inc pi
             if pi < ip.len:
@@ -202,7 +202,7 @@ proc handleAnsiCode(format: var Format, final: char, params: string) =
                   let g = ip[pi]
                   inc pi
                   let b = ip[pi]
-                  format.fgcolor = CellColor(rgb: true, rgbcolor: rgb(r, g, b))
+                  format.fgcolor = rgb(r, g, b).cellColor()
               else:
                 #TODO
                 inc pi
@@ -212,7 +212,7 @@ proc handleAnsiCode(format: var Format, final: char, params: string) =
           of 39:
             format.fgcolor = defaultColor
           of 40..47:
-            format.bgcolor = CellColor(rgb: false, color: uint8(ip[0]))
+            format.bgcolor = uint8(ip[0]).cellColor()
           of 48:
             inc pi
             if pi < ip.len:
@@ -224,7 +224,7 @@ proc handleAnsiCode(format: var Format, final: char, params: string) =
                   let g = ip[pi]
                   inc pi
                   let b = ip[pi]
-                  format.bgcolor = CellColor(rgb: true, rgbcolor: rgb(r, g, b))
+                  format.bgcolor = rgb(r, g, b).cellColor()
               else:
                 #TODO
                 inc pi