about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-08-29 22:57:56 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-08-29 22:57:56 -0700
commit6f1659cfe06be9d1bfaf7474275e0d55a2ff1064 (patch)
treef64a042444d3e7b6377ebfc1a95891904cfcee95
parent0fd11850952795094d2dae31e532a77007166c6d (diff)
downloadmu-6f1659cfe06be9d1bfaf7474275e0d55a2ff1064.tar.gz
2109 - avoid unnecessary repaints
We're still seeing mu hang for long periods if people press and hold say
an arrow key, as the events are all processed. Hopefully this will stop
that from taking too long.

But the real problem is still printing junk to screen because of
sluggishness in processing input.
-rw-r--r--edit.mu6
1 files changed, 6 insertions, 0 deletions
diff --git a/edit.mu b/edit.mu
index 34356efd..a8781162 100644
--- a/edit.mu
+++ b/edit.mu
@@ -4579,6 +4579,9 @@ recipe event-loop [
         screen, recipes, render?:boolean <- handle-keyboard-event screen, recipes, e:event
         {
           break-unless render?
+          # optimization: refresh screen only if no more events
+          more-events?:boolean <- has-more-events? console
+          break-if more-events?
           screen <- render-recipes screen, env
         }
       }
@@ -4587,6 +4590,9 @@ recipe event-loop [
         screen, current-sandbox, render?:boolean <- handle-keyboard-event screen, current-sandbox, e:event
         {
           break-unless render?:boolean
+          # optimization: refresh screen only if no more events
+          more-events?:boolean <- has-more-events? console
+          break-if more-events?
           screen <- render-sandbox-side screen, env
         }
       }