diff options
Diffstat (limited to 'html/edit')
-rw-r--r-- | html/edit/001-editor.mu.html | 12 | ||||
-rw-r--r-- | html/edit/003-shortcuts.mu.html | 2 | ||||
-rw-r--r-- | html/edit/004-programming-environment.mu.html | 4 | ||||
-rw-r--r-- | html/edit/012-editor-undo.mu.html | 5 |
4 files changed, 10 insertions, 13 deletions
diff --git a/html/edit/001-editor.mu.html b/html/edit/001-editor.mu.html index ae213b6b..cc75c8a6 100644 --- a/html/edit/001-editor.mu.html +++ b/html/edit/001-editor.mu.html @@ -108,9 +108,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> <span class="Comment"># early exit if text is empty</span> - <span class="muControl">return-unless</span> text, editor/same-as-ingredient:0 + <span class="muControl">return-unless</span> text len:num <span class="Special"><-</span> length *text - <span class="muControl">return-unless</span> len, editor/same-as-ingredient:0 + <span class="muControl">return-unless</span> len idx:num <span class="Special"><-</span> copy<span class="Constant"> 0</span> <span class="Comment"># now we can start appending the rest, character by character</span> curr:&:duplex-list:char <span class="Special"><-</span> get *editor, <span class="Constant">data:offset</span> @@ -124,7 +124,6 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color idx <span class="Special"><-</span> add idx,<span class="Constant"> 1</span> <span class="muControl">loop</span> <span class="Delimiter">}</span> - <span class="muControl">return</span> editor/same-as-ingredient:0 ] <span class="muScenario">scenario</span> editor-initializes-without-data [ @@ -158,7 +157,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muRecipe">def</span> render screen:&:screen, editor:&:editor<span class="muRecipe"> -> </span>last-row:num, last-column:num, screen:&:screen, editor:&:editor [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> - <span class="muControl">return-unless</span> editor, <span class="Constant">1/top</span>, <span class="Constant">0/left</span>, screen/same-as-ingredient:0, editor/same-as-ingredient:1 + <span class="muControl">return-unless</span> editor, <span class="Constant">1/top</span>, <span class="Constant">0/left</span> left:num <span class="Special"><-</span> get *editor, <span class="Constant">left:offset</span> screen-height:num <span class="Special"><-</span> screen-height screen right:num <span class="Special"><-</span> get *editor, <span class="Constant">right:offset</span> @@ -253,7 +252,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color *editor <span class="Special"><-</span> put *editor, <span class="Constant">cursor-row:offset</span>, cursor-row *editor <span class="Special"><-</span> put *editor, <span class="Constant">cursor-column:offset</span>, cursor-column *editor <span class="Special"><-</span> put *editor, <span class="Constant">before-cursor:offset</span>, before-cursor - <span class="muControl">return</span> row, column, screen/same-as-ingredient:0, editor/same-as-ingredient:1 + <span class="muControl">return</span> row, column ] <span class="muRecipe">def</span> clear-screen-from screen:&:screen, row:num, column:num, left:num, right:num<span class="muRecipe"> -> </span>screen:&:screen [ @@ -263,13 +262,12 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Delimiter">{</span> <span class="muControl">break-if</span> screen clear-display-from row, column, left, right - <span class="muControl">return</span> screen/same-as-ingredient:0 + <span class="muControl">return</span> <span class="Delimiter">}</span> <span class="Comment"># if not, go the slower route</span> screen <span class="Special"><-</span> move-cursor screen, row, column clear-line-until screen, right clear-rest-of-screen screen, row, left, right - <span class="muControl">return</span> screen/same-as-ingredient:0 ] <span class="muRecipe">def</span> clear-rest-of-screen screen:&:screen, row:num, left:num, right:num<span class="muRecipe"> -> </span>screen:&:screen [ diff --git a/html/edit/003-shortcuts.mu.html b/html/edit/003-shortcuts.mu.html index 3e248a6c..9225ac1a 100644 --- a/html/edit/003-shortcuts.mu.html +++ b/html/edit/003-shortcuts.mu.html @@ -512,7 +512,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color cursor-column <span class="Special"><-</span> copy left *editor <span class="Special"><-</span> put *editor, <span class="Constant">cursor-column:offset</span>, cursor-column below-screen?:bool <span class="Special"><-</span> greater-or-equal cursor-row, screen-height <span class="Comment"># must be equal</span> - <span class="muControl">return-unless</span> below-screen?, editor/same-as-ingredient:0, <span class="Constant">0/no-more-render</span> + <span class="muControl">return-unless</span> below-screen?, editor, <span class="Constant">0/no-more-render</span> <span class="Constant"> <scroll-down></span> cursor-row <span class="Special"><-</span> subtract cursor-row,<span class="Constant"> 1</span> <span class="Comment"># bring back into screen range</span> *editor <span class="Special"><-</span> put *editor, <span class="Constant">cursor-row:offset</span>, cursor-row diff --git a/html/edit/004-programming-environment.mu.html b/html/edit/004-programming-environment.mu.html index 8b6e4c62..f363ac7e 100644 --- a/html/edit/004-programming-environment.mu.html +++ b/html/edit/004-programming-environment.mu.html @@ -239,7 +239,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muRecipe">def</span> render-without-moving-cursor screen:&:screen, editor:&:editor<span class="muRecipe"> -> </span>last-row:num, last-column:num, screen:&:screen, editor:&:editor [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> - <span class="muControl">return-unless</span> editor, <span class="Constant">1/top</span>, <span class="Constant">0/left</span>, screen/same-as-ingredient:0, editor/same-as-ingredient:1 + <span class="muControl">return-unless</span> editor, <span class="Constant">1/top</span>, <span class="Constant">0/left</span> left:num <span class="Special"><-</span> get *editor, <span class="Constant">left:offset</span> screen-height:num <span class="Special"><-</span> screen-height screen right:num <span class="Special"><-</span> get *editor, <span class="Constant">right:offset</span> @@ -313,7 +313,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Comment"># save first character off-screen</span> *editor <span class="Special"><-</span> put *editor, <span class="Constant">bottom-of-screen:offset</span>, curr *editor <span class="Special"><-</span> put *editor, <span class="Constant">bottom:offset</span>, row - <span class="muControl">return</span> row, column, screen/same-as-ingredient:0, editor/same-as-ingredient:1 + <span class="muControl">return</span> row, column ] <span class="muScenario">scenario</span> point-at-multiple-editors [ diff --git a/html/edit/012-editor-undo.mu.html b/html/edit/012-editor-undo.mu.html index 7ff25219..c0f6d84a 100644 --- a/html/edit/012-editor-undo.mu.html +++ b/html/edit/012-editor-undo.mu.html @@ -109,7 +109,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color redo <span class="Special"><-</span> push op, redo *editor <span class="Special"><-</span> put *editor, <span class="Constant">redo:offset</span>, redo <span class="Constant"> <handle-undo></span> - <span class="muControl">return</span> screen/same-as-ingredient:0, editor/same-as-ingredient:1, <span class="Constant">1/go-render</span> + <span class="muControl">return</span> screen, editor, <span class="Constant">1/go-render</span> <span class="Delimiter">}</span> ] @@ -127,7 +127,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color undo <span class="Special"><-</span> push op, undo *editor <span class="Special"><-</span> put *editor, <span class="Constant">undo:offset</span>, undo <span class="Constant"> <handle-redo></span> - <span class="muControl">return</span> screen/same-as-ingredient:0, editor/same-as-ingredient:1, <span class="Constant">1/go-render</span> + <span class="muControl">return</span> screen, editor, <span class="Constant">1/go-render</span> <span class="Delimiter">}</span> ] @@ -241,7 +241,6 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color redo:&:list:&:operation <span class="Special"><-</span> get *editor, <span class="Constant">redo:offset</span> redo <span class="Special"><-</span> copy<span class="Constant"> 0</span> *editor <span class="Special"><-</span> put *editor, <span class="Constant">redo:offset</span>, redo - <span class="muControl">return</span> editor/same-as-ingredient:0 ] <span class="muRecipe">after</span> <span class="Constant"><handle-undo></span> [ |