diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-09-17 18:03:26 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-09-17 18:03:26 -0700 |
commit | cebb5fca612321f9436f324d6b95e94b0f1ac614 (patch) | |
tree | bc6c4f0e659990da24c019cdaefef4d9cb3ac2b1 /html/edit/006-sandbox-copy.mu.html | |
parent | 2d91279bacda12ea42608b4aa74f66589772fce9 (diff) | |
download | mu-cebb5fca612321f9436f324d6b95e94b0f1ac614.tar.gz |
3397
Diffstat (limited to 'html/edit/006-sandbox-copy.mu.html')
-rw-r--r-- | html/edit/006-sandbox-copy.mu.html | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/html/edit/006-sandbox-copy.mu.html b/html/edit/006-sandbox-copy.mu.html index 987f38f9..dd5adf80 100644 --- a/html/edit/006-sandbox-copy.mu.html +++ b/html/edit/006-sandbox-copy.mu.html @@ -48,8 +48,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-console [ press F4 ] - <span class="Constant">3</span>:&:programming-environment-data<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">1</span>:text, <span class="Constant">2</span>:text - event-loop screen:&:screen, console:&:console, <span class="Constant">3</span>:&:programming-environment-data + <span class="Constant">3</span>:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">1</span>:text, <span class="Constant">2</span>:text + event-loop screen:&:screen, console:&:console, <span class="Constant">3</span>:&:environment screen-should-contain [ <span class="Constant"> . run (F4) .</span> <span class="Constant"> . ┊ .</span> @@ -65,7 +65,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color left-click <span class="Constant">3</span>, <span class="Constant">69</span> ] run [ - event-loop screen:&:screen, console:&:console, <span class="Constant">3</span>:&:programming-environment-data + event-loop screen:&:screen, console:&:console, <span class="Constant">3</span>:&:environment ] <span class="Comment"># it copies into editor</span> screen-should-contain [ @@ -83,7 +83,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[0]</span> ] run [ - event-loop screen:&:screen, console:&:console, <span class="Constant">3</span>:&:programming-environment-data + event-loop screen:&:screen, console:&:console, <span class="Constant">3</span>:&:environment ] screen-should-contain [ <span class="Constant"> . run (F4) .</span> @@ -110,8 +110,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-console [ press F4 ] - <span class="Constant">3</span>:&:programming-environment-data<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">1</span>:text, <span class="Constant">2</span>:text - event-loop screen:&:screen, console:&:console, <span class="Constant">3</span>:&:programming-environment-data + <span class="Constant">3</span>:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">1</span>:text, <span class="Constant">2</span>:text + event-loop screen:&:screen, console:&:console, <span class="Constant">3</span>:&:environment screen-should-contain [ <span class="Constant"> . run (F4) .</span> <span class="Constant"> . ┊ .</span> @@ -127,7 +127,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color left-click <span class="Constant">3</span>, <span class="Constant">84</span> ] run [ - event-loop screen:&:screen, console:&:console, <span class="Constant">3</span>:&:programming-environment-data + event-loop screen:&:screen, console:&:console, <span class="Constant">3</span>:&:environment ] <span class="Comment"># it copies into editor</span> screen-should-contain [ @@ -145,7 +145,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[0]</span> ] run [ - event-loop screen:&:screen, console:&:console, <span class="Constant">3</span>:&:programming-environment-data + event-loop screen:&:screen, console:&:console, <span class="Constant">3</span>:&:environment ] screen-should-contain [ <span class="Constant"> . run (F4) .</span> @@ -175,14 +175,14 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] <span class="Comment"># some preconditions for attempting to copy a sandbox</span> -<span class="muRecipe">def</span> should-attempt-copy? click-row:num, click-column:num, env:&:programming-environment-data<span class="muRecipe"> -> </span>result:bool [ +<span class="muRecipe">def</span> should-attempt-copy? click-row:num, click-column:num, env:&:environment<span class="muRecipe"> -> </span>result:bool [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> <span class="Comment"># are we below the sandbox editor?</span> click-sandbox-area?:bool<span class="Special"> <- </span>click-on-sandbox-area? click-row, click-column, env <span class="muControl">reply-unless</span> click-sandbox-area?, <span class="Constant">0/false</span> <span class="Comment"># narrower, is the click in the columns spanning the 'copy' button?</span> - first-sandbox:&:editor-data<span class="Special"> <- </span>get *env, <span class="Constant">current-sandbox:offset</span> + first-sandbox:&:editor<span class="Special"> <- </span>get *env, <span class="Constant">current-sandbox:offset</span> assert first-sandbox, <span class="Constant">[!!]</span> sandbox-left-margin:num<span class="Special"> <- </span>get *first-sandbox, <span class="Constant">left:offset</span> sandbox-right-margin:num<span class="Special"> <- </span>get *first-sandbox, <span class="Constant">right:offset</span> @@ -190,19 +190,19 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color copy-button-vertical-area?:bool<span class="Special"> <- </span>within-range? click-column, copy-button-left, copy-button-right <span class="muControl">reply-unless</span> copy-button-vertical-area?, <span class="Constant">0/false</span> <span class="Comment"># finally, is sandbox editor empty?</span> - current-sandbox:&:editor-data<span class="Special"> <- </span>get *env, <span class="Constant">current-sandbox:offset</span> + current-sandbox:&:editor<span class="Special"> <- </span>get *env, <span class="Constant">current-sandbox:offset</span> result<span class="Special"> <- </span>empty-editor? current-sandbox ] -<span class="muRecipe">def</span> try-copy-sandbox click-row:num, env:&:programming-environment-data<span class="muRecipe"> -> </span>clicked-on-copy-button?:bool, env:&:programming-environment-data [ +<span class="muRecipe">def</span> try-copy-sandbox click-row:num, env:&:environment<span class="muRecipe"> -> </span>clicked-on-copy-button?:bool, env:&:environment [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> <span class="Comment"># identify the sandbox to copy, if the click was actually on the 'copy' button</span> - sandbox:&:sandbox-data<span class="Special"> <- </span>find-sandbox env, click-row + sandbox:&:sandbox<span class="Special"> <- </span>find-sandbox env, click-row <span class="muControl">return-unless</span> sandbox, <span class="Constant">0/false</span> clicked-on-copy-button?<span class="Special"> <- </span>copy <span class="Constant">1/true</span> text:text<span class="Special"> <- </span>get *sandbox, <span class="Constant">data:offset</span> - current-sandbox:&:editor-data<span class="Special"> <- </span>get *env, <span class="Constant">current-sandbox:offset</span> + current-sandbox:&:editor<span class="Special"> <- </span>get *env, <span class="Constant">current-sandbox:offset</span> current-sandbox<span class="Special"> <- </span>insert-text current-sandbox, text <span class="Comment"># reset scroll</span> *env<span class="Special"> <- </span>put *env, <span class="Constant">render-from:offset</span>, <span class="Constant">-1</span> @@ -210,10 +210,10 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color *env<span class="Special"> <- </span>put *env, <span class="Constant">sandbox-in-focus?:offset</span>, <span class="Constant">1/true</span> ] -<span class="muRecipe">def</span> find-sandbox env:&:programming-environment-data, click-row:num<span class="muRecipe"> -> </span>result:&:sandbox-data [ +<span class="muRecipe">def</span> find-sandbox env:&:environment, click-row:num<span class="muRecipe"> -> </span>result:&:sandbox [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> - curr-sandbox:&:sandbox-data<span class="Special"> <- </span>get *env, <span class="Constant">sandbox:offset</span> + curr-sandbox:&:sandbox<span class="Special"> <- </span>get *env, <span class="Constant">sandbox:offset</span> <span class="Delimiter">{</span> <span class="muControl">break-unless</span> curr-sandbox start:num<span class="Special"> <- </span>get *curr-sandbox, <span class="Constant">starting-row-on-screen:offset</span> @@ -225,20 +225,20 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muControl">return</span> <span class="Constant">0/not-found</span> ] -<span class="muRecipe">def</span> click-on-sandbox-area? click-row:num, click-column:num, env:&:programming-environment-data<span class="muRecipe"> -> </span>result:bool [ +<span class="muRecipe">def</span> click-on-sandbox-area? click-row:num, click-column:num, env:&:environment<span class="muRecipe"> -> </span>result:bool [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> - current-sandbox:&:editor-data<span class="Special"> <- </span>get *env, <span class="Constant">current-sandbox:offset</span> + current-sandbox:&:editor<span class="Special"> <- </span>get *env, <span class="Constant">current-sandbox:offset</span> sandbox-left-margin:num<span class="Special"> <- </span>get *current-sandbox, <span class="Constant">left:offset</span> on-sandbox-side?:bool<span class="Special"> <- </span>greater-or-equal click-column, sandbox-left-margin <span class="muControl">return-unless</span> on-sandbox-side?, <span class="Constant">0/false</span> - first-sandbox:&:sandbox-data<span class="Special"> <- </span>get *env, <span class="Constant">sandbox:offset</span> + first-sandbox:&:sandbox<span class="Special"> <- </span>get *env, <span class="Constant">sandbox:offset</span> <span class="muControl">return-unless</span> first-sandbox, <span class="Constant">0/false</span> first-sandbox-begins:num<span class="Special"> <- </span>get *first-sandbox, <span class="Constant">starting-row-on-screen:offset</span> result<span class="Special"> <- </span>greater-or-equal click-row, first-sandbox-begins ] -<span class="muRecipe">def</span> empty-editor? editor:&:editor-data<span class="muRecipe"> -> </span>result:bool [ +<span class="muRecipe">def</span> empty-editor? editor:&:editor<span class="muRecipe"> -> </span>result:bool [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> head:&:duplex-list:char<span class="Special"> <- </span>get *editor, <span class="Constant">data:offset</span> @@ -267,8 +267,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color assume-console [ press F4 ] - <span class="Constant">3</span>:&:programming-environment-data<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">1</span>:text, <span class="Constant">2</span>:text - event-loop screen:&:screen, console:&:console, <span class="Constant">3</span>:&:programming-environment-data + <span class="Constant">3</span>:&:environment<span class="Special"> <- </span>new-programming-environment screen:&:screen, <span class="Constant">1</span>:text, <span class="Constant">2</span>:text + event-loop screen:&:screen, console:&:console, <span class="Constant">3</span>:&:environment screen-should-contain [ <span class="Constant"> . run (F4) .</span> <span class="Constant"> . ┊ .</span> @@ -286,7 +286,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color left-click <span class="Constant">3</span>, <span class="Constant">70</span> <span class="Comment"># click 'copy' button</span> ] run [ - event-loop screen:&:screen, console:&:console, <span class="Constant">3</span>:&:programming-environment-data + event-loop screen:&:screen, console:&:console, <span class="Constant">3</span>:&:environment ] <span class="Comment"># copy doesn't happen</span> screen-should-contain [ @@ -304,7 +304,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color type <span class="Constant">[1]</span> ] run [ - event-loop screen:&:screen, console:&:console, <span class="Constant">3</span>:&:programming-environment-data + event-loop screen:&:screen, console:&:console, <span class="Constant">3</span>:&:environment ] screen-should-contain [ <span class="Constant"> . run (F4) .</span> |