about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-06-22 11:37:52 -0700
committerKartik K. Agaram <vc@akkartik.com>2017-06-22 11:37:52 -0700
commita4020a806fca821931a3ca8279ef2697bb62583e (patch)
treed960378c2fe39bf191a29ff28daf5e1d454352ba
parentbde85557ac92d30564ce17ae1f5b5924e88982d9 (diff)
downloadmu-a4020a806fca821931a3ca8279ef2697bb62583e.tar.gz
3939
-rw-r--r--edit/004-programming-environment.mu9
-rw-r--r--edit/005-sandbox.mu3
-rw-r--r--sandbox/004-programming-environment.mu7
-rw-r--r--sandbox/005-sandbox.mu3
4 files changed, 16 insertions, 6 deletions
diff --git a/edit/004-programming-environment.mu b/edit/004-programming-environment.mu
index c1f8af7f..897f2923 100644
--- a/edit/004-programming-environment.mu
+++ b/edit/004-programming-environment.mu
@@ -403,7 +403,6 @@ def render-all screen:&:screen, env:&:environment, render-editor:render-recipe -
   local-scope
   load-ingredients
   trace 10, [app], [render all]
-  old-top-idx:num <- save-top-idx screen
   # top menu
   trace 11, [app], [render top menu]
   width:num <- screen-width screen
@@ -427,14 +426,13 @@ def render-all screen:&:screen, env:&:environment, render-editor:render-recipe -
   current-sandbox:&:editor <- get *env, current-sandbox:offset
   sandbox-in-focus?:bool <- get *env, sandbox-in-focus?:offset
   screen <- update-cursor screen, recipes, current-sandbox, sandbox-in-focus?, env
-  #
-  assert-no-scroll screen, old-top-idx
 ]
 
 def render-recipes screen:&:screen, env:&:environment, render-editor:render-recipe -> screen:&:screen, env:&:environment [
   local-scope
   load-ingredients
   trace 11, [app], [render recipes]
+  old-top-idx:num <- save-top-idx screen
   recipes:&:editor <- get *env, recipes:offset
   # render recipes
   left:num <- get *recipes, left:offset
@@ -447,6 +445,8 @@ def render-recipes screen:&:screen, env:&:environment, render-editor:render-reci
   draw-horizontal screen, row, left, right, 9480/horizontal-dotted
   row <- add row, 1
   clear-screen-from screen, row, left, left, right
+  #
+  assert-no-scroll screen, old-top-idx
 ]
 
 # replaced in a later layer
@@ -454,6 +454,7 @@ def render-sandbox-side screen:&:screen, env:&:environment, render-editor:render
   local-scope
   load-ingredients
   trace 11, [app], [render sandboxes]
+  old-top-idx:num <- save-top-idx screen
   current-sandbox:&:editor <- get *env, current-sandbox:offset
   left:num <- get *current-sandbox, left:offset
   right:num <- get *current-sandbox, right:offset
@@ -464,6 +465,8 @@ def render-sandbox-side screen:&:screen, env:&:environment, render-editor:render
   draw-horizontal screen, row, left, right
   row <- add row, 1
   clear-screen-from screen, row, left, left, right
+  #
+  assert-no-scroll screen, old-top-idx
 ]
 
 def update-cursor screen:&:screen, recipes:&:editor, current-sandbox:&:editor, sandbox-in-focus?:bool, env:&:environment -> screen:&:screen [
diff --git a/edit/005-sandbox.mu b/edit/005-sandbox.mu
index 2be439e3..255dfc35 100644
--- a/edit/005-sandbox.mu
+++ b/edit/005-sandbox.mu
@@ -247,6 +247,7 @@ def! render-sandbox-side screen:&:screen, env:&:environment, render-editor:rende
   local-scope
   load-ingredients
   trace 11, [app], [render sandbox side]
+  old-top-idx:num <- save-top-idx screen
   current-sandbox:&:editor <- get *env, current-sandbox:offset
   row:num, column:num <- copy 1, 0
   left:num <- get *current-sandbox, left:offset
@@ -265,6 +266,8 @@ def! render-sandbox-side screen:&:screen, env:&:environment, render-editor:rende
   sandbox:&:sandbox <- get *env, sandbox:offset
   row, screen <- render-sandboxes screen, sandbox, left, right, row, render-from
   clear-rest-of-screen screen, row, left, right
+  #
+  assert-no-scroll screen, old-top-idx
 ]
 
 def render-sandboxes screen:&:screen, sandbox:&:sandbox, left:num, right:num, row:num, render-from:num, idx:num -> row:num, screen:&:screen, sandbox:&:sandbox [
diff --git a/sandbox/004-programming-environment.mu b/sandbox/004-programming-environment.mu
index 8204f296..e0667604 100644
--- a/sandbox/004-programming-environment.mu
+++ b/sandbox/004-programming-environment.mu
@@ -197,7 +197,6 @@ def render-all screen:&:screen, env:&:environment, render-editor:render-recipe -
   local-scope
   load-ingredients
   trace 10, [app], [render all]
-  old-top-idx:num <- save-top-idx screen
   # top menu
   trace 11, [app], [render top menu]
   width:num <- screen-width screen
@@ -213,14 +212,14 @@ def render-all screen:&:screen, env:&:environment, render-editor:render-recipe -
   #
   current-sandbox:&:editor <- get *env, current-sandbox:offset
   screen <- update-cursor screen, current-sandbox, env
-  #
-  assert-no-scroll screen, old-top-idx
 ]
 
 # replaced in a later layer
 def render-sandbox-side screen:&:screen, env:&:environment, render-editor:render-recipe -> screen:&:screen, env:&:environment [
   local-scope
   load-ingredients
+  trace 11, [app], [render sandboxes]
+  old-top-idx:num <- save-top-idx screen
   current-sandbox:&:editor <- get *env, current-sandbox:offset
   left:num <- get *current-sandbox, left:offset
   right:num <- get *current-sandbox, right:offset
@@ -231,6 +230,8 @@ def render-sandbox-side screen:&:screen, env:&:environment, render-editor:render
   draw-horizontal screen, row, left, right
   row <- add row, 1
   clear-screen-from screen, row, left, left, right
+  #
+  assert-no-scroll screen, old-top-idx
 ]
 
 def update-cursor screen:&:screen, current-sandbox:&:editor, env:&:environment -> screen:&:screen [
diff --git a/sandbox/005-sandbox.mu b/sandbox/005-sandbox.mu
index 7e760502..3d06b7d9 100644
--- a/sandbox/005-sandbox.mu
+++ b/sandbox/005-sandbox.mu
@@ -231,6 +231,7 @@ def! render-sandbox-side screen:&:screen, env:&:environment, render-editor:rende
   local-scope
   load-ingredients
   trace 11, [app], [render sandbox side]
+  old-top-idx:num <- save-top-idx screen
   current-sandbox:&:editor <- get *env, current-sandbox:offset
   row:num, column:num <- copy 1, 0
   left:num <- get *current-sandbox, left:offset
@@ -249,6 +250,8 @@ def! render-sandbox-side screen:&:screen, env:&:environment, render-editor:rende
   sandbox:&:sandbox <- get *env, sandbox:offset
   row, screen <- render-sandboxes screen, sandbox, left, right, row, render-from, 0, env
   clear-rest-of-screen screen, row, left, right
+  #
+  assert-no-scroll screen, old-top-idx
 ]
 
 def render-sandboxes screen:&:screen, sandbox:&:sandbox, left:num, right:num, row:num, render-from:num, idx:num -> row:num, screen:&:screen, sandbox:&:sandbox [