diff options
Diffstat (limited to 'html/edit')
-rw-r--r-- | html/edit/001-editor.mu.html | 232 | ||||
-rw-r--r-- | html/edit/002-typing.mu.html | 596 | ||||
-rw-r--r-- | html/edit/003-shortcuts.mu.html | 1418 | ||||
-rw-r--r-- | html/edit/004-programming-environment.mu.html | 414 | ||||
-rw-r--r-- | html/edit/005-sandbox.mu.html | 474 | ||||
-rw-r--r-- | html/edit/006-sandbox-copy.mu.html | 90 | ||||
-rw-r--r-- | html/edit/007-sandbox-delete.mu.html | 84 | ||||
-rw-r--r-- | html/edit/008-sandbox-edit.mu.html | 64 | ||||
-rw-r--r-- | html/edit/009-sandbox-test.mu.html | 80 | ||||
-rw-r--r-- | html/edit/010-sandbox-trace.mu.html | 90 | ||||
-rw-r--r-- | html/edit/011-errors.mu.html | 132 | ||||
-rw-r--r-- | html/edit/012-editor-undo.mu.html | 888 |
12 files changed, 2281 insertions, 2281 deletions
diff --git a/html/edit/001-editor.mu.html b/html/edit/001-editor.mu.html index a0044e7a..01b0bf0a 100644 --- a/html/edit/001-editor.mu.html +++ b/html/edit/001-editor.mu.html @@ -87,22 +87,22 @@ 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"># no clipping of bounds</span> - right<span class="Special"> <- </span>subtract right, <span class="Constant">1</span> - result<span class="Special"> <- </span>new <span class="Constant">editor:type</span> + right <span class="Special"><-</span> subtract right,<span class="Constant"> 1</span> + result <span class="Special"><-</span> new <span class="Constant">editor:type</span> <span class="Comment"># initialize screen-related fields</span> - *result<span class="Special"> <- </span>put *result, <span class="Constant">left:offset</span>, left - *result<span class="Special"> <- </span>put *result, <span class="Constant">right:offset</span>, right + *result <span class="Special"><-</span> put *result, <span class="Constant">left:offset</span>, left + *result <span class="Special"><-</span> put *result, <span class="Constant">right:offset</span>, right <span class="Comment"># initialize cursor coordinates</span> - *result<span class="Special"> <- </span>put *result, <span class="Constant">cursor-row:offset</span>, <span class="Constant">1/top</span> - *result<span class="Special"> <- </span>put *result, <span class="Constant">cursor-column:offset</span>, left + *result <span class="Special"><-</span> put *result, <span class="Constant">cursor-row:offset</span>, <span class="Constant">1/top</span> + *result <span class="Special"><-</span> put *result, <span class="Constant">cursor-column:offset</span>, left <span class="Comment"># initialize empty contents</span> - init:&:duplex-list:char<span class="Special"> <- </span>push <span class="Constant">167/§</span>, <span class="Constant">0/tail</span> - *result<span class="Special"> <- </span>put *result, <span class="Constant">data:offset</span>, init - *result<span class="Special"> <- </span>put *result, <span class="Constant">top-of-screen:offset</span>, init - *result<span class="Special"> <- </span>put *result, <span class="Constant">before-cursor:offset</span>, init - result<span class="Special"> <- </span>insert-text result, s + init:&:duplex-list:char <span class="Special"><-</span> push <span class="Constant">167/§</span>, <span class="Constant">0/tail</span> + *result <span class="Special"><-</span> put *result, <span class="Constant">data:offset</span>, init + *result <span class="Special"><-</span> put *result, <span class="Constant">top-of-screen:offset</span>, init + *result <span class="Special"><-</span> put *result, <span class="Constant">before-cursor:offset</span>, init + result <span class="Special"><-</span> insert-text result, s <span class="Comment"># initial render to screen, just for some old tests</span> - _, _, screen, result<span class="Special"> <- </span>render screen, result + _, _, screen, result <span class="Special"><-</span> render screen, result <span class="Constant"> <editor-initialization></span> ] @@ -110,42 +110,42 @@ 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:<span class="Constant">0</span> - len:num<span class="Special"> <- </span>length *text - <span class="muControl">return-unless</span> len, editor/same-as-ingredient:<span class="Constant">0</span> - idx:num<span class="Special"> <- </span>copy <span class="Constant">0</span> + <span class="muControl">return-unless</span> text, editor/same-as-ingredient:0 + len:num <span class="Special"><-</span> length *text + <span class="muControl">return-unless</span> len, editor/same-as-ingredient:0 + 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> + curr:&:duplex-list:char <span class="Special"><-</span> get *editor, <span class="Constant">data:offset</span> <span class="Delimiter">{</span> - done?:bool<span class="Special"> <- </span>greater-or-equal idx, len + done?:bool <span class="Special"><-</span> greater-or-equal idx, len <span class="muControl">break-if</span> done? - c:char<span class="Special"> <- </span>index *text, idx + c:char <span class="Special"><-</span> index *text, idx insert c, curr <span class="Comment"># next iter</span> - curr<span class="Special"> <- </span>next curr - idx<span class="Special"> <- </span>add idx, <span class="Constant">1</span> + curr <span class="Special"><-</span> next curr + 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:<span class="Constant">0</span> + <span class="muControl">return</span> editor/same-as-ingredient:0 ] <span class="muScenario">scenario</span> editor-initializes-without-data [ <span class="Constant">local-scope</span> assume-screen <span class="Constant">5/width</span>, <span class="Constant">3/height</span> run [ - e:&:editor<span class="Special"> <- </span>new-editor <span class="Constant">0/data</span>, screen:&:screen, <span class="Constant">2/left</span>, <span class="Constant">5/right</span> - <span class="Constant">2</span>:editor/<span class="Special">raw <- </span>copy *e + e:&:editor <span class="Special"><-</span> new-editor <span class="Constant">0/data</span>, screen:&:screen, <span class="Constant">2/left</span>, <span class="Constant">5/right</span> + 2:editor/<span class="Special">raw</span> <span class="Special"><-</span> copy *e ] memory-should-contain [ <span class="Comment"># 2 (data) <- just the § sentinel</span> <span class="Comment"># 3 (top of screen) <- the § sentinel</span> - <span class="Constant">4</span><span class="Special"> <- </span><span class="Constant">0</span> <span class="Comment"># bottom-of-screen; null since text fits on screen</span> + <span class="Constant"> 4</span> <span class="Special"><-</span><span class="Constant"> 0</span> <span class="Comment"># bottom-of-screen; null since text fits on screen</span> <span class="Comment"># 5 (before cursor) <- the § sentinel</span> - <span class="Constant">6</span><span class="Special"> <- </span><span class="Constant">2</span> <span class="Comment"># left</span> - <span class="Constant">7</span><span class="Special"> <- </span><span class="Constant">4</span> <span class="Comment"># right (inclusive)</span> - <span class="Constant">8</span><span class="Special"> <- </span><span class="Constant">1</span> <span class="Comment"># bottom</span> - <span class="Constant">9</span><span class="Special"> <- </span><span class="Constant">1</span> <span class="Comment"># cursor row</span> - <span class="Constant">10</span><span class="Special"> <- </span><span class="Constant">2</span> <span class="Comment"># cursor column</span> + <span class="Constant"> 6</span> <span class="Special"><-</span><span class="Constant"> 2</span> <span class="Comment"># left</span> + <span class="Constant"> 7</span> <span class="Special"><-</span><span class="Constant"> 4</span> <span class="Comment"># right (inclusive)</span> + <span class="Constant"> 8</span> <span class="Special"><-</span><span class="Constant"> 1</span> <span class="Comment"># bottom</span> + <span class="Constant"> 9</span> <span class="Special"><-</span><span class="Constant"> 1</span> <span class="Comment"># cursor row</span> + <span class="Constant"> 10</span> <span class="Special"><-</span><span class="Constant"> 2</span> <span class="Comment"># cursor column</span> ] screen-should-contain [ <span class="Constant"> . .</span> @@ -160,102 +160,102 @@ 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:<span class="Constant">0</span>, editor/same-as-ingredient:<span class="Constant">1</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> + <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 + 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> <span class="Comment"># traversing editor</span> - curr:&:duplex-list:char<span class="Special"> <- </span>get *editor, <span class="Constant">top-of-screen:offset</span> - prev:&:duplex-list:char<span class="Special"> <- </span>copy curr <span class="Comment"># just in case curr becomes null and we can't compute prev</span> - curr<span class="Special"> <- </span>next curr + curr:&:duplex-list:char <span class="Special"><-</span> get *editor, <span class="Constant">top-of-screen:offset</span> + prev:&:duplex-list:char <span class="Special"><-</span> copy curr <span class="Comment"># just in case curr becomes null and we can't compute prev</span> + curr <span class="Special"><-</span> next curr <span class="Comment"># traversing screen</span> <span class="Constant"> +render-loop-initialization</span> - color:num<span class="Special"> <- </span>copy <span class="Constant">7/white</span> - row:num<span class="Special"> <- </span>copy <span class="Constant">1/top</span> - column:num<span class="Special"> <- </span>copy left - cursor-row:num<span class="Special"> <- </span>get *editor, <span class="Constant">cursor-row:offset</span> - cursor-column:num<span class="Special"> <- </span>get *editor, <span class="Constant">cursor-column:offset</span> - before-cursor:&:duplex-list:char<span class="Special"> <- </span>get *editor, <span class="Constant">before-cursor:offset</span> - screen<span class="Special"> <- </span>move-cursor screen, row, column + color:num <span class="Special"><-</span> copy <span class="Constant">7/white</span> + row:num <span class="Special"><-</span> copy <span class="Constant">1/top</span> + column:num <span class="Special"><-</span> copy left + cursor-row:num <span class="Special"><-</span> get *editor, <span class="Constant">cursor-row:offset</span> + cursor-column:num <span class="Special"><-</span> get *editor, <span class="Constant">cursor-column:offset</span> + before-cursor:&:duplex-list:char <span class="Special"><-</span> get *editor, <span class="Constant">before-cursor:offset</span> + screen <span class="Special"><-</span> move-cursor screen, row, column <span class="Delimiter">{</span> <span class="Constant"> +next-character</span> <span class="muControl">break-unless</span> curr - off-screen?:bool<span class="Special"> <- </span>greater-or-equal row, screen-height + off-screen?:bool <span class="Special"><-</span> greater-or-equal row, screen-height <span class="muControl">break-if</span> off-screen? <span class="Comment"># update editor.before-cursor</span> <span class="Comment"># Doing so at the start of each iteration ensures it stays one step behind</span> <span class="Comment"># the current character.</span> <span class="Delimiter">{</span> - at-cursor-row?:bool<span class="Special"> <- </span>equal row, cursor-row + at-cursor-row?:bool <span class="Special"><-</span> equal row, cursor-row <span class="muControl">break-unless</span> at-cursor-row? - at-cursor?:bool<span class="Special"> <- </span>equal column, cursor-column + at-cursor?:bool <span class="Special"><-</span> equal column, cursor-column <span class="muControl">break-unless</span> at-cursor? - before-cursor<span class="Special"> <- </span>copy prev + before-cursor <span class="Special"><-</span> copy prev <span class="Delimiter">}</span> - c:char<span class="Special"> <- </span>get *curr, <span class="Constant">value:offset</span> + c:char <span class="Special"><-</span> get *curr, <span class="Constant">value:offset</span> <span class="Constant"> <character-c-received></span> <span class="Delimiter">{</span> <span class="Comment"># newline? move to left rather than 0</span> - newline?:bool<span class="Special"> <- </span>equal c, <span class="Constant">10/newline</span> + newline?:bool <span class="Special"><-</span> equal c, <span class="Constant">10/newline</span> <span class="muControl">break-unless</span> newline? <span class="Comment"># adjust cursor if necessary</span> <span class="Delimiter">{</span> - at-cursor-row?:bool<span class="Special"> <- </span>equal row, cursor-row + at-cursor-row?:bool <span class="Special"><-</span> equal row, cursor-row <span class="muControl">break-unless</span> at-cursor-row? - left-of-cursor?:bool<span class="Special"> <- </span>lesser-than column, cursor-column + left-of-cursor?:bool <span class="Special"><-</span> lesser-than column, cursor-column <span class="muControl">break-unless</span> left-of-cursor? - cursor-column<span class="Special"> <- </span>copy column - before-cursor<span class="Special"> <- </span>prev curr + cursor-column <span class="Special"><-</span> copy column + before-cursor <span class="Special"><-</span> prev curr <span class="Delimiter">}</span> <span class="Comment"># clear rest of line in this window</span> clear-line-until screen, right <span class="Comment"># skip to next line</span> - row<span class="Special"> <- </span>add row, <span class="Constant">1</span> - column<span class="Special"> <- </span>copy left - screen<span class="Special"> <- </span>move-cursor screen, row, column - curr<span class="Special"> <- </span>next curr - prev<span class="Special"> <- </span>next prev + row <span class="Special"><-</span> add row,<span class="Constant"> 1</span> + column <span class="Special"><-</span> copy left + screen <span class="Special"><-</span> move-cursor screen, row, column + curr <span class="Special"><-</span> next curr + prev <span class="Special"><-</span> next prev <span class="muControl">loop</span> <span class="Constant">+next-character</span> <span class="Delimiter">}</span> <span class="Delimiter">{</span> <span class="Comment"># at right? wrap. even if there's only one more letter left; we need</span> <span class="Comment"># room for clicking on the cursor after it.</span> - at-right?:bool<span class="Special"> <- </span>equal column, right + at-right?:bool <span class="Special"><-</span> equal column, right <span class="muControl">break-unless</span> at-right? <span class="Comment"># print wrap icon</span> - wrap-icon:char<span class="Special"> <- </span>copy <span class="Constant">8617/loop-back-to-left</span> + wrap-icon:char <span class="Special"><-</span> copy <span class="Constant">8617/loop-back-to-left</span> print screen, wrap-icon, <span class="Constant">245/grey</span> - column<span class="Special"> <- </span>copy left - row<span class="Special"> <- </span>add row, <span class="Constant">1</span> - screen<span class="Special"> <- </span>move-cursor screen, row, column + column <span class="Special"><-</span> copy left + row <span class="Special"><-</span> add row,<span class="Constant"> 1</span> + screen <span class="Special"><-</span> move-cursor screen, row, column |