about summary refs log tree commit diff stats
path: root/src/display
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-12-01 08:59:44 +0100
committerbptato <nincsnevem662@gmail.com>2022-12-01 08:59:44 +0100
commitb1794c0961a5efb30a0dafa34845bedf49261819 (patch)
tree9f2a0a4770cc3644d435c2bfc2168fce06204838 /src/display
parent8bb35b0ea47eb91cc2703e27ca94c07b6a5cb9a3 (diff)
downloadchawan-b1794c0961a5efb30a0dafa34845bedf49261819.tar.gz
Fix some screen update issues, remove redraw timer
For now it's unnecessary; may be re-added later to support some dynamic
document features.
Diffstat (limited to 'src/display')
-rw-r--r--src/display/client.nim6
-rw-r--r--src/display/pager.nim7
2 files changed, 2 insertions, 11 deletions
diff --git a/src/display/client.nim b/src/display/client.nim
index 364a4963..cee12cf1 100644
--- a/src/display/client.nim
+++ b/src/display/client.nim
@@ -272,7 +272,6 @@ proc inputLoop(client: Client) =
   discard c_setvbuf(client.console.tty, nil, IONBF, 0)
   selector.registerHandle(int(client.console.tty.getFileHandle()), {Read}, nil)
   let sigwinch = selector.registerSignal(int(SIGWINCH), nil)
-  let redrawtimer = client.selector.registerTimer(1000, false, nil)
   while true:
     let events = client.selector.select(-1)
     for event in events:
@@ -294,10 +293,7 @@ proc inputLoop(client: Client) =
           client.pager.windowChange(client.attrs)
         else: assert false
       if Event.Timer in event.events:
-        if event.fd == redrawtimer:
-          if client.pager.container != nil:
-            client.pager.container.requestLines()
-        elif event.fd in client.interval_fdis:
+        if event.fd in client.interval_fdis:
           client.intervals[client.interval_fdis[event.fd]].handler()
         elif event.fd in client.timeout_fdis:
           let id = client.timeout_fdis[event.fd]
diff --git a/src/display/pager.nim b/src/display/pager.nim
index 614974c2..eedcc477 100644
--- a/src/display/pager.nim
+++ b/src/display/pager.nim
@@ -287,7 +287,7 @@ proc redraw(pager: Pager) {.jsfunc.} =
 
 proc draw*(pager: Pager) =
   pager.term.hideCursor()
-  if pager.redraw or pager.container != nil and pager.container.redraw:
+  if pager.redraw:
     pager.refreshDisplay()
     pager.term.writeGrid(pager.display)
   if pager.lineedit.isSome:
@@ -302,7 +302,6 @@ proc draw*(pager: Pager) =
   pager.term.showCursor()
   pager.term.flush()
   pager.redraw = false
-  pager.container.redraw = false
 
 proc registerContainer*(pager: Pager, container: Container) =
   pager.procmap[container.process] = container
@@ -528,11 +527,7 @@ proc updateReadLineISearch(pager: Pager, linemode: LineMode) =
       else:
         pager.container.cursorPrevMatch(pager.iregex.get, true)
       pager.container.hlon = true
-    if not pager.container.redraw:
-      #TODO this is dumb
-      pager.container.requestLines()
     pager.container.pushCursorPos()
-    pager.redraw = true
   of FINISH:
     if pager.iregex.isSome:
       pager.regex = pager.iregex