From 9e751bb8c0cdf771d34c839cb6591d892b8e62de Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 7 Mar 2017 01:41:48 -0800 Subject: 3761 --- html/edit/008-sandbox-edit.mu.html | 279 +++++++++++++++++++------------------ 1 file changed, 140 insertions(+), 139 deletions(-) (limited to 'html/edit/008-sandbox-edit.mu.html') diff --git a/html/edit/008-sandbox-edit.mu.html b/html/edit/008-sandbox-edit.mu.html index e253a4c5..e1a3ecc6 100644 --- a/html/edit/008-sandbox-edit.mu.html +++ b/html/edit/008-sandbox-edit.mu.html @@ -15,15 +15,16 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color a { text-decoration: none; } a:hover { text-decoration: underline; } * { font-size: 12pt; font-size: 1em; } -.Delimiter { color: #800080; } -.muControl { color: #c0a020; } +.Conceal { color: #4e4e4e; } +.muScenario { color: #00af00; } .Special { color: #c00000; } +.Delimiter { color: #800080; } .SalientComment { color: #00ffff; } .Constant { color: #00a0a0; } .LineNr { color: #444444; } -.Comment { color: #9090ff; } .muRecipe { color: #ff8700; } -.muScenario { color: #00af00; } +.Comment { color: #9090ff; } +.muControl { color: #c0a020; } --> @@ -70,45 +71,45 @@ if ('onhashchange' in window) { 10 env:&:environment <- new-programming-environment resources, screen, [add 2, 2] 11 # run it 12 assume-console [ - 13 press F4 + 13 ¦ press F4 14 ] 15 event-loop screen, console, env, resources 16 screen-should-contain [ - 17 . run (F4) . - 18 . ╎ . - 19 .╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╎─────────────────────────────────────────────────. - 20 . ╎0 edit copy delete . - 21 . ╎add 2, 2 . - 22 . ╎4 . - 23 . ╎─────────────────────────────────────────────────. - 24 . ╎ . + 17 ¦ . run (F4) . + 18 ¦ . ╎ . + 19 ¦ .╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╎─────────────────────────────────────────────────. + 20 ¦ . ╎0 edit copy delete . + 21 ¦ . ╎add 2, 2 . + 22 ¦ . ╎4 . + 23 ¦ . ╎─────────────────────────────────────────────────. + 24 ¦ . ╎ . 25 ] 26 # click at left edge of 'edit' button 27 assume-console [ - 28 left-click 3, 55 + 28 ¦ left-click 3, 55 29 ] 30 run [ - 31 event-loop screen, console, env, resources + 31 ¦ event-loop screen, console, env, resources 32 ] 33 # it pops back into editor 34 screen-should-contain [ - 35 . run (F4) . - 36 . ╎add 2, 2 . - 37 .╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╎─────────────────────────────────────────────────. - 38 . ╎ . + 35 ¦ . run (F4) . + 36 ¦ . ╎add 2, 2 . + 37 ¦ .╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╎─────────────────────────────────────────────────. + 38 ¦ . ╎ . 39 ] 40 # cursor should be in the right place 41 assume-console [ - 42 type [0] + 42 ¦ type [0] 43 ] 44 run [ - 45 event-loop screen, console, env, resources + 45 ¦ event-loop screen, console, env, resources 46 ] 47 screen-should-contain [ - 48 . run (F4) . - 49 . ╎0add 2, 2 . - 50 .╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╎─────────────────────────────────────────────────. - 51 . ╎ . + 48 ¦ . run (F4) . + 49 ¦ . ╎0add 2, 2 . + 50 ¦ .╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╎─────────────────────────────────────────────────. + 51 ¦ . ╎ . 52 ] 53 ] 54 @@ -122,60 +123,60 @@ if ('onhashchange' in window) { 62 env:&:environment <- new-programming-environment resources, screen, [add 2, 2] 63 # run it 64 assume-console [ - 65 press F4 + 65 ¦ press F4 66 ] 67 event-loop screen, console, env, resources 68 screen-should-contain [ - 69 . run (F4) . - 70 . ╎ . - 71 .╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╎─────────────────────────────────────────────────. - 72 . ╎0 edit copy delete . - 73 . ╎add 2, 2 . - 74 . ╎4 . - 75 . ╎─────────────────────────────────────────────────. - 76 . ╎ . + 69 ¦ . run (F4) . + 70 ¦ . ╎ . + 71 ¦ .╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╎─────────────────────────────────────────────────. + 72 ¦ . ╎0 edit copy delete . + 73 ¦ . ╎add 2, 2 . + 74 ¦ . ╎4 . + 75 ¦ . ╎─────────────────────────────────────────────────. + 76 ¦ . ╎ . 77 ] 78 # click at right edge of 'edit' button (just before 'copy') 79 assume-console [ - 80 left-click 3, 68 + 80 ¦ left-click 3, 68 81 ] 82 run [ - 83 event-loop screen, console, env, resources + 83 ¦ event-loop screen, console, env, resources 84 ] 85 # it pops back into editor 86 screen-should-contain [ - 87 . run (F4) . - 88 . ╎add 2, 2 . - 89 .╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╎─────────────────────────────────────────────────. - 90 . ╎ . + 87 ¦ . run (F4) . + 88 ¦ . ╎add 2, 2 . + 89 ¦ .╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╎─────────────────────────────────────────────────. + 90 ¦ . ╎ . 91 ] 92 # cursor should be in the right place 93 assume-console [ - 94 type [0] + 94 ¦ type [0] 95 ] 96 run [ - 97 event-loop screen, console, env, resources + 97 ¦ event-loop screen, console, env, resources 98 ] 99 screen-should-contain [ -100 . run (F4) . -101 . ╎0add 2, 2 . -102 .╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╎─────────────────────────────────────────────────. -103 . ╎ . +100 ¦ . run (F4) . +101 ¦ . ╎0add 2, 2 . +102 ¦ .╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╎─────────────────────────────────────────────────. +103 ¦ . ╎ . 104 ] 105 ] 106 107 after <global-touch> [ 108 # support 'edit' button 109 { -110 edit?:bool <- should-attempt-edit? click-row, click-column, env -111 break-unless edit? -112 edit?, env <- try-edit-sandbox click-row, env -113 break-unless edit? -114 hide-screen screen -115 screen <- render-sandbox-side screen, env, render -116 screen <- update-cursor screen, recipes, current-sandbox, sandbox-in-focus?, env -117 show-screen screen -118 loop +next-event +110 ¦ edit?:bool <- should-attempt-edit? click-row, click-column, env +111 ¦ break-unless edit? +112 ¦ edit?, env <- try-edit-sandbox click-row, env +113 ¦ break-unless edit? +114 ¦ hide-screen screen +115 ¦ screen <- render-sandbox-side screen, env, render +116 ¦ screen <- update-cursor screen, recipes, current-sandbox, sandbox-in-focus?, env +117 ¦ show-screen screen +118 ¦ loop +next-event 119 } 120 ] 121 @@ -228,37 +229,37 @@ if ('onhashchange' in window) { 168 env:&:environment <- new-programming-environment resources, screen, [print screen, 4] 169 # run the sandbox 170 assume-console [ -171 press F4 +171 ¦ press F4 172 ] 173 event-loop screen, console, env, resources 174 screen-should-contain [ -175 . run (F4) . -176 . ╎ . -177 .╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╎─────────────────────────────────────────────────. -178 . ╎0 edit copy delete . -179 . ╎print screen, 4 . -180 . ╎screen: . -181 . ╎ .4 . . -182 . ╎ . . . -183 . ╎ . . . -184 . ╎ . . . -185 . ╎ . . . -186 . ╎─────────────────────────────────────────────────. -187 . ╎ . +175 ¦ . run (F4) . +176 ¦ . ╎ . +177 ¦ .╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╎─────────────────────────────────────────────────. +178 ¦ . ╎0 edit copy delete . +179 ¦ . ╎print screen, 4 . +180 ¦ . ╎screen: . +181 ¦ . ╎ .4 . . +182 ¦ . ╎ . . . +183 ¦ . ╎ . . . +184 ¦ . ╎ . . . +185 ¦ . ╎ . . . +186 ¦ . ╎─────────────────────────────────────────────────. +187 ¦ . ╎ . 188 ] 189 # edit the sandbox 190 assume-console [ -191 left-click 3, 65 +191 ¦ left-click 3, 65 192 ] 193 run [ -194 event-loop screen, console, env, resources +194 ¦ event-loop screen, console, env, resources 195 ] 196 screen-should-contain [ -197 . run (F4) . -198 . ╎print screen, 4 . -199 .╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╎─────────────────────────────────────────────────. -200 . ╎ . -201 . ╎ . +197 ¦ . run (F4) . +198 ¦ . ╎print screen, 4 . +199 ¦ .╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╎─────────────────────────────────────────────────. +200 ¦ . ╎ . +201 ¦ . ╎ . 202 ] 203 ] 204 @@ -273,41 +274,41 @@ if ('onhashchange' in window) { 213 render-all screen, env, render 214 # create 2 sandboxes and scroll to second 215 assume-console [ -216 press ctrl-n -217 type [add 2, 2] -218 press F4 -219 type [add 1, 1] -220 press F4 -221 press page-down -222 press page-down +216 ¦ press ctrl-n +217 ¦ type [add 2, 2] +218 ¦ press F4 +219 ¦ type [add 1, 1] +220 ¦ press F4 +221 ¦ press page-down +222 ¦ press page-down 223 ] 224 event-loop screen, console, env, resources 225 screen-should-contain [ -226 . run (F4) . -227 . ╎─────────────────────────────────────────────────. -228 .╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╎1 edit copy delete . -229 . ╎add 2, 2 . -230 . ╎4 . -231 . ╎─────────────────────────────────────────────────. -232 . ╎ . +226 ¦ . run (F4) . +227 ¦ . ╎─────────────────────────────────────────────────. +228 ¦ .╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╎1 edit copy delete . +229 ¦ . ╎add 2, 2 . +230 ¦ . ╎4 . +231 ¦ . ╎─────────────────────────────────────────────────. +232 ¦ . ╎ . 233 ] 234 # edit the second sandbox 235 assume-console [ -236 left-click 2, 55 +236 ¦ left-click 2, 55 237 ] 238 run [ -239 event-loop screen, console, env, resources +239 ¦ event-loop screen, console, env, resources 240 ] 241 # second sandbox shows in editor; scroll resets to display first sandbox 242 screen-should-contain [ -243 . run (F4) . -244 . ╎add 2, 2 . -245 .╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╎─────────────────────────────────────────────────. -246 . ╎0 edit copy delete . -247 . ╎add 1, 1 . -248 . ╎2 . -249 . ╎─────────────────────────────────────────────────. -250 . ╎ . +243 ¦ . run (F4) . +244 ¦ . ╎add 2, 2 . +245 ¦ .╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╎─────────────────────────────────────────────────. +246 ¦ . ╎0 edit copy delete . +247 ¦ . ╎add 1, 1 . +248 ¦ . ╎2 . +249 ¦ . ╎─────────────────────────────────────────────────. +250 ¦ . ╎ . 251 ] 252 ] 253 @@ -322,64 +323,64 @@ if ('onhashchange' in window) { 262 render-all screen, env, render 263 # create 2 sandboxes 264 assume-console [ -265 press ctrl-n -266 type [add 2, 2] -267 press F4 -268 type [add 1, 1] -269 press F4 +265 ¦ press ctrl-n +266 ¦ type [add 2, 2] +267 ¦ press F4 +268 ¦ type [add 1, 1] +269 ¦ press F4 270 ] 271 event-loop screen, console, env, resources 272 screen-should-contain [ -273 . run (F4) . -274 . ╎ . -275 .╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╎─────────────────────────────────────────────────. -276 . ╎0 edit copy delete . -277 . ╎add 1, 1 . -278 . ╎2 . -279 . ╎─────────────────────────────────────────────────. -280 . ╎1 edit copy delete . -281 . ╎add 2, 2 . -282 . ╎4 . +273 ¦ . run (F4) . +274 ¦ . ╎ . +275 ¦ .╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╎─────────────────────────────────────────────────. +276 ¦ . ╎0 edit copy delete . +277 ¦ . ╎add 1, 1 . +278 ¦ . ╎2 . +279 ¦ . ╎─────────────────────────────────────────────────. +280 ¦ . ╎1 edit copy delete . +281 ¦ . ╎add 2, 2 . +282 ¦ . ╎4 . 283 ] 284 # edit the second sandbox, then resave 285 assume-console [ -286 left-click 3, 60 -287 press F4 +286 ¦ left-click 3, 60 +287 ¦ press F4 288 ] 289 run [ -290 event-loop screen, console, env, resources +290 ¦ event-loop screen, console, env, resources 291 ] 292 # no change in contents 293 screen-should-contain [ -294 . run (F4) . -295 . ╎ . -296 .╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╎─────────────────────────────────────────────────. -297 . ╎0 edit copy delete . -298 . ╎add 1, 1 . -299 . ╎2 . -300 . ╎─────────────────────────────────────────────────. -301 . ╎1 edit copy delete . -302 . ╎add 2, 2 . -303 . ╎4 . +294 ¦ . run (F4) . +295 ¦ . ╎ . +296 ¦ .╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╎─────────────────────────────────────────────────. +297 ¦ . ╎0 edit copy delete . +298 ¦ . ╎add 1, 1 . +299 ¦ . ╎2 . +300 ¦ . ╎─────────────────────────────────────────────────. +301 ¦ . ╎1 edit copy delete . +302 ¦ . ╎add 2, 2 . +303 ¦ . ╎4 . 304 ] 305 # now try to scroll past end 306 assume-console [ -307 press page-down -308 press page-down -309 press page-down +307 ¦ press page-down +308 ¦ press page-down +309 ¦ press page-down 310 ] 311 run [ -312 event-loop screen, console, env, resources +312 ¦ event-loop screen, console, env, resources 313 ] 314 # screen should show just final sandbox with the right index (1) 315 screen-should-contain [ -316 . run (F4) . -317 . ╎─────────────────────────────────────────────────. -318 .╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╎1 edit copy delete . -319 . ╎add 2, 2 . -320 . ╎4 . -321 . ╎─────────────────────────────────────────────────. -322 . ╎ . +316 ¦ . run (F4) . +317 ¦ . ╎─────────────────────────────────────────────────. +318 ¦ .╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╎1 edit copy delete . +319 ¦ . ╎add 2, 2 . +320 ¦ . ╎4 . +321 ¦ . ╎─────────────────────────────────────────────────. +322 ¦ . ╎ . 323 ] 324 ] -- cgit 1.4.1-2-gfad0