about summary refs log tree commit diff stats
path: root/src/local
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-02-27 17:39:58 +0100
committerbptato <nincsnevem662@gmail.com>2024-02-27 17:44:36 +0100
commit29f4655f5c04eeabb07c7c27bd564e0b4ae896f5 (patch)
treea9a9bd63512caf886b60c0e91bf042bacc78d93d /src/local
parentcf6d0df2240762a4a70edf44a89f8e5d73b0b0c0 (diff)
downloadchawan-29f4655f5c04eeabb07c7c27bd564e0b4ae896f5.tar.gz
buffer: reset prevStyled in switchCharset, reshape
reshape must do a render from zero, as it's a last resort for users to
fixup the page on a rendering bug.

switchCharset must reset prevStyled for obvious reasons (it refers to
a dead document).
Diffstat (limited to 'src/local')
-rw-r--r--src/local/container.nim12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/local/container.nim b/src/local/container.nim
index ef14a303..c4427ec6 100644
--- a/src/local/container.nim
+++ b/src/local/container.nim
@@ -1466,9 +1466,7 @@ proc readSuccess*(container: Container, s: string) =
       container.triggerEvent(ContainerEvent(t: OPEN, request: res.open.get)))
 
 proc reshape(container: Container): EmptyPromise {.jsfunc.} =
-  return container.iface.render().then(proc(lines: int): auto =
-    container.setNumLines(lines)
-    container.triggerEvent(STATUS)
+  return container.iface.forceRender().then(proc(): EmptyPromise =
     return container.requestLines()
   )
 
@@ -1516,13 +1514,9 @@ proc windowChange*(container: Container, attrs: WindowAttributes) =
   if attrs.width != container.width or attrs.height - 1 != container.height:
     container.width = attrs.width
     container.height = attrs.height - 1
-    container.iface.windowChange(attrs).then(proc(): auto =
+    container.iface.windowChange(attrs).then(proc() =
       container.needslines = true
-      return container.iface.render()
-    ).then(proc(lines: int) =
-      if lines != container.numLines:
-        container.setNumLines(lines, true)
-      container.needslines = true)
+    )
 
 proc peek(container: Container) {.jsfunc.} =
   container.alert($container.location)