about summary refs log tree commit diff stats
path: root/browse-slack
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-08-13 22:11:11 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-08-13 22:11:11 -0700
commit29361ac54e9bf671ffb7d6ba7d3e816f5dc0c14c (patch)
tree1d70269b2f6619b7ebf4a36ceb996cedc31123ff /browse-slack
parentdaedeb44fd0dd0aca429a1c414c7e09342b96cfc (diff)
downloadmu-29361ac54e9bf671ffb7d6ba7d3e816f5dc0c14c.tar.gz
slack: more responsive typing
Diffstat (limited to 'browse-slack')
-rw-r--r--browse-slack/environment.mu11
1 files changed, 10 insertions, 1 deletions
diff --git a/browse-slack/environment.mu b/browse-slack/environment.mu
index da58c873..f7ae15e0 100644
--- a/browse-slack/environment.mu
+++ b/browse-slack/environment.mu
@@ -58,7 +58,16 @@ fn initialize-environment _self: (addr environment), _items: (addr item-list) {
 
 ### Render
 
-fn render-environment screen: (addr screen), env: (addr environment), users: (addr array user), channels: (addr array channel), items: (addr item-list) {
+fn render-environment screen: (addr screen), _env: (addr environment), users: (addr array user), channels: (addr array channel), items: (addr item-list) {
+  var env/esi: (addr environment) <- copy _env
+  # don't bother repainting the screen when typing into the search bar
+  {
+    var cursor-in-search?/eax: (addr boolean) <- get env, cursor-in-search?
+    compare *cursor-in-search?, 0/false
+    break-if-=
+    render-search-input screen, env
+    return
+  }
   clear-screen screen
   render-search-input screen, env
   render-channels screen, env, channels