diff options
Diffstat (limited to 'html/edit')
-rw-r--r-- | html/edit/001-editor.mu.html | 20 | ||||
-rw-r--r-- | html/edit/002-typing.mu.html | 28 | ||||
-rw-r--r-- | html/edit/003-shortcuts.mu.html | 60 | ||||
-rw-r--r-- | html/edit/005-sandbox.mu.html | 6 | ||||
-rw-r--r-- | html/edit/006-sandbox-edit.mu.html | 2 | ||||
-rw-r--r-- | html/edit/011-editor-undo.mu.html | 38 |
6 files changed, 77 insertions, 77 deletions
diff --git a/html/edit/001-editor.mu.html b/html/edit/001-editor.mu.html index 916e93c6..cf10dc6c 100644 --- a/html/edit/001-editor.mu.html +++ b/html/edit/001-editor.mu.html @@ -99,7 +99,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } x<span class="Special"> <- </span>get-address *result, <span class="Constant">cursor-column:offset</span> *x<span class="Special"> <- </span>copy left init:address:address:duplex-list:character<span class="Special"> <- </span>get-address *result, <span class="Constant">data:offset</span> - *init<span class="Special"> <- </span>push-duplex <span class="Constant">167/§</span>, <span class="Constant">0/tail</span> + *init<span class="Special"> <- </span>push <span class="Constant">167/§</span>, <span class="Constant">0/tail</span> top-of-screen:address:address:duplex-list:character<span class="Special"> <- </span>get-address *result, <span class="Constant">top-of-screen:offset</span> *top-of-screen<span class="Special"> <- </span>copy *init y:address:address:duplex-list:character<span class="Special"> <- </span>get-address *result, <span class="Constant">before-cursor:offset</span> @@ -127,9 +127,9 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } done?:boolean<span class="Special"> <- </span>greater-or-equal idx, len <span class="muControl">break-if</span> done? c:character<span class="Special"> <- </span>index *text, idx - insert-duplex c, curr + insert c, curr <span class="Comment"># next iter</span> - curr<span class="Special"> <- </span>next-duplex curr + 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> @@ -171,8 +171,8 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } right:number<span class="Special"> <- </span>get *editor, <span class="Constant">right:offset</span> <span class="Comment"># traversing editor</span> curr:address:duplex-list:character<span class="Special"> <- </span>get *editor, <span class="Constant">top-of-screen:offset</span> - prev:address:duplex-list:character<span class="Special"> <- </span>copy curr <span class="Comment"># just in case curr becomes null and we can't compute prev-duplex</span> - curr<span class="Special"> <- </span>next-duplex curr + prev:address:duplex-list:character<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:number<span class="Special"> <- </span>copy <span class="Constant">7/white</span> @@ -210,7 +210,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } left-of-cursor?:boolean<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-duplex curr + *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-delimited screen, column, right @@ -218,8 +218,8 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } 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-duplex curr - prev<span class="Special"> <- </span>next-duplex prev + curr<span class="Special"> <- </span>next curr + prev<span class="Special"> <- </span>next prev <span class="muControl">loop</span> <span class="Constant">+next-character:label</span> <span class="Delimiter">}</span> <span class="Delimiter">{</span> @@ -236,8 +236,8 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="muControl">loop</span> <span class="Constant">+next-character:label</span> <span class="Delimiter">}</span> print-character screen, c, color - curr<span class="Special"> <- </span>next-duplex curr - prev<span class="Special"> <- </span>next-duplex prev + curr<span class="Special"> <- </span>next curr + prev<span class="Special"> <- </span>next prev column<span class="Special"> <- </span>add column, <span class="Constant">1</span> <span class="muControl">loop</span> <span class="Delimiter">}</span> diff --git a/html/edit/002-typing.mu.html b/html/edit/002-typing.mu.html index c1f1128f..538bbf5d 100644 --- a/html/edit/002-typing.mu.html +++ b/html/edit/002-typing.mu.html @@ -114,8 +114,8 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } screen-height:number<span class="Special"> <- </span>screen-height screen <span class="Comment"># count newlines until screen row</span> curr:address:duplex-list:character<span class="Special"> <- </span>get *editor, <span class="Constant">top-of-screen:offset</span> - prev:address:duplex-list:character<span class="Special"> <- </span>copy curr <span class="Comment"># just in case curr becomes null and we can't compute prev-duplex</span> - curr<span class="Special"> <- </span>next-duplex curr + prev:address:duplex-list:character<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 row:number<span class="Special"> <- </span>copy <span class="Constant">1/top</span> column:number<span class="Special"> <- </span>copy left cursor-row:address:number<span class="Special"> <- </span>get-address *editor, <span class="Constant">cursor-row:offset</span> @@ -155,8 +155,8 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <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 - curr<span class="Special"> <- </span>next-duplex curr - prev<span class="Special"> <- </span>next-duplex prev + curr<span class="Special"> <- </span>next curr + prev<span class="Special"> <- </span>next prev <span class="muControl">loop</span> <span class="Constant">+next-character:label</span> <span class="Delimiter">}</span> <span class="Delimiter">{</span> @@ -169,8 +169,8 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Comment"># don't increment curr/prev</span> <span class="muControl">loop</span> <span class="Constant">+next-character:label</span> <span class="Delimiter">}</span> - curr<span class="Special"> <- </span>next-duplex curr - prev<span class="Special"> <- </span>next-duplex prev + curr<span class="Special"> <- </span>next curr + prev<span class="Special"> <- </span>next prev column<span class="Special"> <- </span>add column, <span class="Constant">1</span> <span class="muControl">loop</span> <span class="Delimiter">}</span> @@ -234,8 +234,8 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> before-cursor:address:address:duplex-list:character<span class="Special"> <- </span>get-address *editor, <span class="Constant">before-cursor:offset</span> - insert-duplex c, *before-cursor - *before-cursor<span class="Special"> <- </span>next-duplex *before-cursor + insert c, *before-cursor + *before-cursor<span class="Special"> <- </span>next *before-cursor cursor-row:address:number<span class="Special"> <- </span>get-address *editor, <span class="Constant">cursor-row:offset</span> cursor-column:address:number<span class="Special"> <- </span>get-address *editor, <span class="Constant">cursor-column:offset</span> left:number<span class="Special"> <- </span>get *editor, <span class="Constant">left:offset</span> @@ -248,7 +248,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Constant"> <insert-character-special-case></span> <span class="Comment"># but mostly we'll just move the cursor right</span> *cursor-column<span class="Special"> <- </span>add *cursor-column, <span class="Constant">1</span> - next:address:duplex-list:character<span class="Special"> <- </span>next-duplex *before-cursor + next:address:duplex-list:character<span class="Special"> <- </span>next *before-cursor <span class="Delimiter">{</span> <span class="Comment"># at end of all text? no need to scroll? just print the character and leave</span> at-end?:boolean<span class="Special"> <- </span>equal next, <span class="Constant">0/null</span> @@ -283,7 +283,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="muControl">break-if</span> at-newline? print-character screen, currc curr-column<span class="Special"> <- </span>add curr-column, <span class="Constant">1</span> - curr<span class="Special"> <- </span>next-duplex curr + curr<span class="Special"> <- </span>next curr <span class="muControl">loop</span> <span class="Delimiter">}</span> go-render?<span class="Special"> <- </span>copy <span class="Constant">0/false</span> @@ -867,8 +867,8 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } right:number<span class="Special"> <- </span>get *editor, <span class="Constant">right:offset</span> screen-height:number<span class="Special"> <- </span>screen-height screen <span class="Comment"># insert newline</span> - insert-duplex <span class="Constant">10/newline</span>, *before-cursor - *before-cursor<span class="Special"> <- </span>next-duplex *before-cursor + insert <span class="Constant">10/newline</span>, *before-cursor + *before-cursor<span class="Special"> <- </span>next *before-cursor *cursor-row<span class="Special"> <- </span>add *cursor-row, <span class="Constant">1</span> *cursor-column<span class="Special"> <- </span>copy left <span class="Comment"># maybe scroll</span> @@ -883,7 +883,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } indent?:boolean<span class="Special"> <- </span>get *editor, <span class="Constant">indent?:offset</span> <span class="muControl">reply-unless</span> indent? d:address:duplex-list:character<span class="Special"> <- </span>get *editor, <span class="Constant">data:offset</span> - end-of-previous-line:address:duplex-list:character<span class="Special"> <- </span>prev-duplex *before-cursor + end-of-previous-line:address:duplex-list:character<span class="Special"> <- </span>prev *before-cursor indent:number<span class="Special"> <- </span>line-indent end-of-previous-line, d i:number<span class="Special"> <- </span>copy <span class="Constant">0</span> <span class="Delimiter">{</span> @@ -905,7 +905,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } at-start?:boolean<span class="Special"> <- </span>equal curr, start <span class="muControl">reply-if</span> at-start? <span class="Delimiter">{</span> - curr<span class="Special"> <- </span>prev-duplex curr + curr<span class="Special"> <- </span>prev curr <span class="muControl">break-unless</span> curr at-start?:boolean<span class="Special"> <- </span>equal curr, start <span class="muControl">break-if</span> at-start? diff --git a/html/edit/003-shortcuts.mu.html b/html/edit/003-shortcuts.mu.html index 023f8448..aabe23e0 100644 --- a/html/edit/003-shortcuts.mu.html +++ b/html/edit/003-shortcuts.mu.html @@ -119,14 +119,14 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Constant">load-ingredients</span> before-cursor:address:address:duplex-list:character<span class="Special"> <- </span>get-address *editor, <span class="Constant">before-cursor:offset</span> <span class="Comment"># if at start of text (before-cursor at § sentinel), return</span> - prev:address:duplex-list:character<span class="Special"> <- </span>prev-duplex *before-cursor + prev:address:duplex-list:character<span class="Special"> <- </span>prev *before-cursor go-render?, backspaced-cell<span class="Special"> <- </span>copy <span class="Constant">0/no-more-render</span>, <span class="Constant">0/nothing-deleted</span> <span class="muControl">reply-unless</span> prev trace <span class="Constant">10</span>, <span class="Constant">[app]</span>, <span class="Constant">[delete-before-cursor]</span> original-row:number<span class="Special"> <- </span>get *editor, <span class="Constant">cursor-row:offset</span> editor, scroll?:boolean<span class="Special"> <- </span>move-cursor-coordinates-left editor backspaced-cell:address:duplex-list:character<span class="Special"> <- </span>copy *before-cursor - remove-duplex *before-cursor <span class="Comment"># will also neatly trim next/prev pointers in backspaced-cell/*before-cursor</span> + remove *before-cursor <span class="Comment"># will also neatly trim next/prev pointers in backspaced-cell/*before-cursor</span> *before-cursor<span class="Special"> <- </span>copy prev go-render?<span class="Special"> <- </span>copy <span class="Constant">1/true</span> <span class="muControl">reply-if</span> scroll? @@ -139,7 +139,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="muControl">reply-unless</span> same-row? left:number<span class="Special"> <- </span>get *editor, <span class="Constant">left:offset</span> right:number<span class="Special"> <- </span>get *editor, <span class="Constant">right:offset</span> - curr:address:duplex-list:character<span class="Special"> <- </span>next-duplex *before-cursor + curr:address:duplex-list:character<span class="Special"> <- </span>next *before-cursor screen<span class="Special"> <- </span>move-cursor screen, cursor-row, cursor-column curr-column:number<span class="Special"> <- </span>copy cursor-column <span class="Delimiter">{</span> @@ -154,7 +154,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="muControl">break-if</span> at-newline? screen<span class="Special"> <- </span>print-character screen, currc curr-column<span class="Special"> <- </span>add curr-column, <span class="Constant">1</span> - curr<span class="Special"> <- </span>next-duplex curr + curr<span class="Special"> <- </span>next curr <span class="muControl">loop</span> <span class="Delimiter">}</span> <span class="Comment"># we're guaranteed not to be at the right margin</span> @@ -218,7 +218,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } at-start?:boolean<span class="Special"> <- </span>equal curr, start <span class="muControl">reply-if</span> at-start? <span class="Delimiter">{</span> - curr<span class="Special"> <- </span>prev-duplex curr + curr<span class="Special"> <- </span>prev curr <span class="muControl">break-unless</span> curr at-start?:boolean<span class="Special"> <- </span>equal curr, start <span class="muControl">break-if</span> at-start? @@ -367,16 +367,16 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> before-cursor:address:address:duplex-list:character<span class="Special"> <- </span>get-address *editor, <span class="Constant">before-cursor:offset</span> - deleted-cell:address:duplex-list:character<span class="Special"> <- </span>next-duplex *before-cursor + deleted-cell:address:duplex-list:character<span class="Special"> <- </span>next *before-cursor go-render?<span class="Special"> <- </span>copy <span class="Constant">0/false</span> <span class="muControl">reply-unless</span> deleted-cell currc:character<span class="Special"> <- </span>get *deleted-cell, <span class="Constant">value:offset</span> - remove-duplex deleted-cell + remove deleted-cell deleted-newline?:boolean<span class="Special"> <- </span>equal currc, <span class="Constant">10/newline</span> go-render?<span class="Special"> <- </span>copy <span class="Constant">1/true</span> <span class="muControl">reply-if</span> deleted-newline? <span class="Comment"># wasn't a newline? render rest of line</span> - curr:address:duplex-list:character<span class="Special"> <- </span>next-duplex *before-cursor <span class="Comment"># refresh after remove-duplex above</span> + curr:address:duplex-list:character<span class="Special"> <- </span>next *before-cursor <span class="Comment"># refresh after remove above</span> cursor-row:address:number<span class="Special"> <- </span>get-address *editor, <span class="Constant">cursor-row:offset</span> cursor-column:address:number<span class="Special"> <- </span>get-address *editor, <span class="Constant">cursor-column:offset</span> screen<span class="Special"> <- </span>move-cursor screen, *cursor-row, *cursor-column @@ -394,7 +394,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="muControl">break-if</span> at-newline? screen<span class="Special"> <- </span>print-character screen, currc curr-column<span class="Special"> <- </span>add curr-column, <span class="Constant">1</span> - curr<span class="Special"> <- </span>next-duplex curr + curr<span class="Special"> <- </span>next curr <span class="muControl">loop</span> <span class="Delimiter">}</span> <span class="Comment"># we're guaranteed not to be at the right margin</span> @@ -431,7 +431,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } move-to-next-character?:boolean<span class="Special"> <- </span>equal *k, <span class="Constant">65514/right-arrow</span> <span class="muControl">break-unless</span> move-to-next-character? <span class="Comment"># if not at end of text</span> - next-cursor:address:duplex-list:character<span class="Special"> <- </span>next-duplex *before-cursor + next-cursor:address:duplex-list:character<span class="Special"> <- </span>next *before-cursor <span class="muControl">break-unless</span> next-cursor <span class="Comment"># scan to next character</span> <span class="Constant"> <move-cursor-begin></span> @@ -474,7 +474,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } at-wrap?:boolean<span class="Special"> <- </span>equal *cursor-column, wrap-column <span class="muControl">break-unless</span> at-wrap? <span class="Comment"># and if next character isn't newline</span> - next:address:duplex-list:character<span class="Special"> <- </span>next-duplex before-cursor + next:address:duplex-list:character<span class="Special"> <- </span>next before-cursor <span class="muControl">break-unless</span> next next-character:character<span class="Special"> <- </span>get *next, <span class="Constant">value:offset</span> newline?:boolean<span class="Special"> <- </span>equal next-character, <span class="Constant">10/newline</span> @@ -708,7 +708,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="muControl">break-unless</span> move-to-previous-character? trace <span class="Constant">10</span>, <span class="Constant">[app]</span>, <span class="Constant">[left arrow]</span> <span class="Comment"># if not at start of text (before-cursor at § sentinel)</span> - prev:address:duplex-list:character<span class="Special"> <- </span>prev-duplex *before-cursor + prev:address:duplex-list:character<span class="Special"> <- </span>prev *before-cursor go-render?<span class="Special"> <- </span>copy <span class="Constant">0/false</span> <span class="muControl">reply-unless</span> prev <span class="Constant"> <move-cursor-begin></span> @@ -954,7 +954,7 @@ d] <span class="Delimiter">{</span> done?:boolean<span class="Special"> <- </span>greater-or-equal *cursor-column, target-column <span class="muControl">break-if</span> done? - curr:address:duplex-list:character<span class="Special"> <- </span>next-duplex *before-cursor + curr:address:duplex-list:character<span class="Special"> <- </span>next *before-cursor <span class="muControl">break-unless</span> curr currc:character<span class="Special"> <- </span>get *curr, <span class="Constant">value:offset</span> at-newline?:boolean<span class="Special"> <- </span>equal currc, <span class="Constant">10/newline</span> @@ -1171,7 +1171,7 @@ def] <span class="Delimiter">{</span> done?:boolean<span class="Special"> <- </span>greater-or-equal *cursor-column, target-column <span class="muControl">break-if</span> done? - curr:address:duplex-list:character<span class="Special"> <- </span>next-duplex *before-cursor + curr:address:duplex-list:character<span class="Special"> <- </span>next *before-cursor <span class="muControl">break-unless</span> curr currc:character<span class="Special"> <- </span>get *curr, <span class="Constant">value:offset</span> at-newline?:boolean<span class="Special"> <- </span>equal currc, <span class="Constant">10/newline</span> @@ -1295,7 +1295,7 @@ def] prev:character<span class="Special"> <- </span>get **before-cursor, <span class="Constant">value:offset</span> at-start-of-line?:boolean<span class="Special"> <- </span>equal prev, <span class="Constant">10/newline</span> <span class="muControl">break-if</span> at-start-of-line? - *before-cursor<span class="Special"> <- </span>prev-duplex *before-cursor + *before-cursor<span class="Special"> <- </span>prev *before-cursor assert *before-cursor, <span class="Constant">[move-to-start-of-line tried to move before start of text]</span> <span class="muControl">loop</span> <span class="Delimiter">}</span> @@ -1456,7 +1456,7 @@ def] cursor-column:address:number<span class="Special"> <- </span>get-address *editor, <span class="Constant">cursor-column:offset</span> <span class="Comment"># while not at start of line, move </span> <span class="Delimiter">{</span> - next:address:duplex-list:character<span class="Special"> <- </span>next-duplex *before-cursor + next:address:duplex-list:character<span class="Special"> <- </span>next *before-cursor <span class="muControl">break-unless</span> next <span class="Comment"># end of text</span> nextc:character<span class="Special"> <- </span>get *next, <span class="Constant">value:offset</span> at-end-of-line?:boolean<span class="Special"> <- </span>equal nextc, <span class="Constant">10/newline</span> @@ -1586,20 +1586,20 @@ def] init:address:duplex-list:character<span class="Special"> <- </span>get *editor, <span class="Constant">data:offset</span> before-cursor:address:address:duplex-list:character<span class="Special"> <- </span>get-address *editor, <span class="Constant">before-cursor:offset</span> start:address:duplex-list:character<span class="Special"> <- </span>copy *before-cursor - end:address:duplex-list:character<span class="Special"> <- </span>next-duplex *before-cursor + end:address:duplex-list:character<span class="Special"> <- </span>next *before-cursor <span class="Delimiter">{</span> at-start-of-text?:boolean<span class="Special"> <- </span>equal start, init <span class="muControl">break-if</span> at-start-of-text? curr:character<span class="Special"> <- </span>get *start, <span class="Constant">value:offset</span> at-start-of-line?:boolean<span class="Special"> <- </span>equal curr, <span class="Constant">10/newline</span> <span class="muControl">break-if</span> at-start-of-line? - start<span class="Special"> <- </span>prev-duplex start + start<span class="Special"> <- </span>prev start assert start, <span class="Constant">[delete-to-start-of-line tried to move before start of text]</span> <span class="muControl">loop</span> <span class="Delimiter">}</span> <span class="Comment"># snip it out</span> - result:address:duplex-list:character<span class="Special"> <- </span>next-duplex start - remove-duplex-between start, end + result:address:duplex-list:character<span class="Special"> <- </span>next start + remove-between start, end <span class="Comment"># adjust cursor</span> *before-cursor<span class="Special"> <- </span>copy start left:number<span class="Special"> <- </span>get *editor, <span class="Constant">left:offset</span> @@ -1718,19 +1718,19 @@ def] <span class="Constant">load-ingredients</span> <span class="Comment"># compute range to delete</span> start:address:duplex-list:character<span class="Special"> <- </span>get *editor, <span class="Constant">before-cursor:offset</span> - end:address:duplex-list:character<span class="Special"> <- </span>next-duplex start + end:address:duplex-list:character<span class="Special"> <- </span>next start <span class="Delimiter">{</span> at-end-of-text?:boolean<span class="Special"> <- </span>equal end, <span class="Constant">0/null</span> <span class="muControl">break-if</span> at-end-of-text? curr:character<span class="Special"> <- </span>get *end, <span class="Constant">value:offset</span> at-end-of-line?:boolean<span class="Special"> <- </span>equal curr, <span class="Constant">10/newline</span> <span class="muControl">break-if</span> at-end-of-line? - end<span class="Special"> <- </span>next-duplex end + end<span class="Special"> <- </span>next end <span class="muControl">loop</span> <span class="Delimiter">}</span> <span class="Comment"># snip it out</span> - result<span class="Special"> <- </span>next-duplex start - remove-duplex-between start, end + result<span class="Special"> <- </span>next start + remove-between start, end ] <span class="muScenario">scenario</span> editor-deletes-to-end-of-line-with-ctrl-k-2 [ @@ -1908,7 +1908,7 @@ def] c:character<span class="Special"> <- </span>get *curr, <span class="Constant">value:offset</span> at-newline?:boolean<span class="Special"> <- </span>equal c, <span class="Constant">10/newline</span> <span class="muControl">break-unless</span> at-newline? - curr<span class="Special"> <- </span>next-duplex curr + curr<span class="Special"> <- </span>next curr count<span class="Special"> <- </span>add count, <span class="Constant">1</span> <span class="Delimiter">}</span> <span class="Delimiter">{</span> @@ -1918,7 +1918,7 @@ def] c:character<span class="Special"> <- </span>get *curr, <span class="Constant">value:offset</span> at-newline?:boolean<span class="Special"> <- </span>equal c, <span class="Constant">10/newline</span> <span class="muControl">break-if</span> at-newline? - curr<span class="Special"> <- </span>next-duplex curr + curr<span class="Special"> <- </span>next curr count<span class="Special"> <- </span>add count, <span class="Constant">1</span> <span class="muControl">loop</span> <span class="Delimiter">}</span> @@ -2280,7 +2280,7 @@ def] <span class="Delimiter">{</span> <span class="muControl">break-if</span> len <span class="Comment"># empty line; just skip this newline</span> - prev:address:duplex-list:character<span class="Special"> <- </span>prev-duplex curr + prev:address:duplex-list:character<span class="Special"> <- </span>prev curr <span class="muControl">reply-unless</span> prev, curr <span class="muControl">reply</span> prev <span class="Delimiter">}</span> @@ -2296,7 +2296,7 @@ def] <span class="Delimiter">{</span> done?:boolean<span class="Special"> <- </span>greater-or-equal count, max <span class="muControl">break-if</span> done? - prev:address:duplex-list:character<span class="Special"> <- </span>prev-duplex curr + prev:address:duplex-list:character<span class="Special"> <- </span>prev curr <span class="muControl">break-unless</span> prev curr<span class="Special"> <- </span>copy prev count<span class="Special"> <- </span>add count, <span class="Constant">1</span> @@ -2682,13 +2682,13 @@ e] <span class="muControl">reply-unless</span> bottom-of-screen <span class="Comment"># if not, position cursor at final character</span> before-cursor:address:address:duplex-list:character<span class="Special"> <- </span>get-address *editor, <span class="Constant">before-cursor:offset</span> - *before-cursor<span class="Special"> <- </span>prev-duplex bottom-of-screen + *before-cursor<span class="Special"> <- </span>prev bottom-of-screen <span class="Comment"># keep one line in common with previous page</span> <span class="Delimiter">{</span> last:character<span class="Special"> <- </span>get **before-cursor, <span class="Constant">value:offset</span> newline?:boolean<span class="Special"> <- </span>equal last, <span class="Constant">10/newline</span> <span class="muControl">break-unless</span> newline?:boolean - *before-cursor<span class="Special"> <- </span>prev-duplex *before-cursor + *before-cursor<span class="Special"> <- </span>prev *before-cursor <span class="Delimiter">}</span> <span class="Comment"># move cursor and top-of-screen to start of that line</span> move-to-start-of-line editor diff --git a/html/edit/005-sandbox.mu.html b/html/edit/005-sandbox.mu.html index 3fdab8a0..85fdf7da 100644 --- a/html/edit/005-sandbox.mu.html +++ b/html/edit/005-sandbox.mu.html @@ -186,7 +186,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } *dest<span class="Special"> <- </span>copy new-sandbox <span class="Comment"># clear sandbox editor</span> init:address:address:duplex-list:character<span class="Special"> <- </span>get-address *current-sandbox, <span class="Constant">data:offset</span> - *init<span class="Special"> <- </span>push-duplex <span class="Constant">167/§</span>, <span class="Constant">0/tail</span> + *init<span class="Special"> <- </span>push <span class="Constant">167/§</span>, <span class="Constant">0/tail</span> top-of-screen:address:address:duplex-list:character<span class="Special"> <- </span>get-address *current-sandbox, <span class="Constant">top-of-screen:offset</span> *top-of-screen<span class="Special"> <- </span>copy *init <span class="Delimiter">}</span> @@ -509,13 +509,13 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } curr:address:duplex-list:character<span class="Special"> <- </span>get *editor, <span class="Constant">data:offset</span> <span class="Comment"># skip § sentinel</span> assert curr, <span class="Constant">[editor without data is illegal; must have at least a sentinel]</span> - curr<span class="Special"> <- </span>next-duplex curr + curr<span class="Special"> <- </span>next curr <span class="muControl">reply-unless</span> curr, <span class="Constant">0</span> <span class="Delimiter">{</span> <span class="muControl">break-unless</span> curr c:character<span class="Special"> <- </span>get *curr, <span class="Constant">value:offset</span> buffer-append buf, c - curr<span class="Special"> <- </span>next-duplex curr + curr<span class="Special"> <- </span>next curr <span class="muControl">loop</span> <span class="Delimiter">}</span> result<span class="Special"> <- </span>buffer-to-array buf diff --git a/html/edit/006-sandbox-edit.mu.html b/html/edit/006-sandbox-edit.mu.html index 2381b4bd..2381ec45 100644 --- a/html/edit/006-sandbox-edit.mu.html +++ b/html/edit/006-sandbox-edit.mu.html @@ -127,7 +127,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> head:address:duplex-list:character<span class="Special"> <- </span>get *editor, <span class="Constant">data:offset</span> - first:address:duplex-list:character<span class="Special"> <- </span>next-duplex head + first:address:duplex-list:character<span class="Special"> <- </span>next head result<span class="Special"> <- </span>not first ] diff --git a/html/edit/011-editor-undo.mu.html b/html/edit/011-editor-undo.mu.html index b50f0063..5a3f537e 100644 --- a/html/edit/011-editor-undo.mu.html +++ b/html/edit/011-editor-undo.mu.html @@ -185,7 +185,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } previous-coalesce-tag:number<span class="Special"> <- </span>get *typing, <span class="Constant">tag:offset</span> <span class="muControl">break-unless</span> previous-coalesce-tag insert-until:address:address:duplex-list:character<span class="Special"> <- </span>get-address *typing, <span class="Constant">insert-until:offset</span> - *insert-until<span class="Special"> <- </span>next-duplex *before-cursor + *insert-until<span class="Special"> <- </span>next *before-cursor after-row:address:number<span class="Special"> <- </span>get-address *typing, <span class="Constant">after-row:offset</span> *after-row<span class="Special"> <- </span>copy *cursor-row after-column:address:number<span class="Special"> <- </span>get-address *typing, <span class="Constant">after-column:offset</span> @@ -195,8 +195,8 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="muControl">break</span> <span class="Constant">+done-adding-insert-operation:label</span> <span class="Delimiter">}</span> <span class="Comment"># if not, create a new operation</span> - insert-from:address:duplex-list:character<span class="Special"> <- </span>next-duplex cursor-before - insert-to:address:duplex-list:character<span class="Special"> <- </span>next-duplex insert-from + insert-from:address:duplex-list:character<span class="Special"> <- </span>next cursor-before + insert-to:address:duplex-list:character<span class="Special"> <- </span>next insert-from op:address:operation<span class="Special"> <- </span>new <span class="Constant">operation:type</span> *op<span class="Special"> <- </span>merge <span class="Constant">0/insert-operation</span>, save-row/<span class="muRecipe">before</span>, save-column/<span class="muRecipe">before</span>, top-before, *cursor-row/<span class="muRecipe">after</span>, *cursor-column/<span class="muRecipe">after</span>, top-after, insert-from, insert-to, <span class="Constant">1/coalesce</span> editor<span class="Special"> <- </span>add-operation editor, op @@ -213,8 +213,8 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="muRecipe">before</span> <span class="Constant"><insert-enter-end></span> [ top-after:address:duplex-list:character<span class="Special"> <- </span>get *editor, <span class="Constant">top-of-screen:offset</span> <span class="Comment"># never coalesce</span> - insert-from:address:duplex-list:character<span class="Special"> <- </span>next-duplex cursor-before - insert-to:address:duplex-list:character<span class="Special"> <- </span>next-duplex *before-cursor + insert-from:address:duplex-list:character<span class="Special"> <- </span>next cursor-before + insert-to:address:duplex-list:character<span class="Special"> <- </span>next *before-cursor op:address:operation<span class="Special"> <- </span>new <span class="Constant">operation:type</span> *op<span class="Special"> <- </span>merge <span class="Constant">0/insert-operation</span>, cursor-row-before, cursor-column-before, top-before, *cursor-row/<span class="muRecipe">after</span>, *cursor-column/<span class="muRecipe">after</span>, top-after, insert-from, insert-to, <span class="Constant">0/never-coalesce</span> editor<span class="Special"> <- </span>add-operation editor, op @@ -241,8 +241,8 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } start:address:duplex-list:character<span class="Special"> <- </span>get *typing, <span class="Constant">insert-from:offset</span> end:address:duplex-list:character<span class="Special"> <- </span>get *typing, <span class="Constant">insert-until:offset</span> <span class="Comment"># assert cursor-row/cursor-column/top-of-screen match after-row/after-column/after-top-of-screen</span> - *before-cursor<span class="Special"> <- </span>prev-duplex start - remove-duplex-between *before-cursor, end + *before-cursor<span class="Special"> <- </span>prev start + remove-between *before-cursor, end *cursor-row<span class="Special"> <- </span>get *typing, <span class="Constant">before-row:offset</span> *cursor-column<span class="Special"> <- </span>get *typing, <span class="Constant">before-column:offset</span> top:address:address:duplex-list:character<span class="Special"> <- </span>get-address *editor, <span class="Constant">top-of-screen:offset</span> @@ -436,8 +436,8 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } typing:address:insert-operation<span class="Special"> <- </span>maybe-convert *op, <span class="Constant">typing:variant</span> <span class="muControl">break-unless</span> typing insert-from:address:duplex-list:character<span class="Special"> <- </span>get *typing, <span class="Constant">insert-from:offset</span> <span class="Comment"># ignore insert-to because it's already been spliced away</span> - <span class="Comment"># assert insert-to matches next-duplex(*before-cursor)</span> - insert-duplex-range *before-cursor, insert-from + <span class="Comment"># assert insert-to matches next(*before-cursor)</span> + insert-range *before-cursor, insert-from <span class="Comment"># assert cursor-row/cursor-column/top-of-screen match after-row/after-column/after-top-of-screen</span> *cursor-row<span class="Special"> <- </span>get *typing, <span class="Constant">after-row:offset</span> *cursor-column<span class="Special"> <- </span>get *typing, <span class="Constant">after-column:offset</span> @@ -1643,7 +1643,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } delete-from:address:address:duplex-list:character<span class="Special"> <- </span>get-address *deletion, <span class="Constant">delete-from:offset</span> *delete-from<span class="Special"> <- </span>copy *before-cursor backspaced-so-far:address:address:duplex-list:character<span class="Special"> <- </span>get-address *deletion, <span class="Constant">deleted-text:offset</span> - insert-duplex-range backspaced-cell, *backspaced-so-far + insert-range backspaced-cell, *backspaced-so-far *backspaced-so-far<span class="Special"> <- </span>copy backspaced-cell after-row:address:number<span class="Special"> <- </span>get-address *deletion, <span class="Constant">after-row:offset</span> *after-row<span class="Special"> <- </span>copy *cursor-row @@ -1655,7 +1655,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Delimiter">}</span> <span class="Comment"># if not, create a new operation</span> op:address:operation<span class="Special"> <- </span>new <span class="Constant">operation:type</span> - deleted-until:address:duplex-list:character<span class="Special"> <- </span>next-duplex *before-cursor + deleted-until:address:duplex-list:character<span class="Special"> <- </span>next *before-cursor *op<span class="Special"> <- </span>merge <span class="Constant">2/delete-operation</span>, save-row/<span class="muRecipe">before</span>, save-column/<span class="muRecipe">before</span>, top-before, *cursor-row/<span class="muRecipe">after</span>, *cursor-column/<span class="muRecipe">after</span>, top-after, backspaced-cell/deleted, *before-cursor/delete-from, deleted-until, <span class="Constant">1/coalesce-backspace</span> editor<span class="Special"> <- </span>add-operation editor, op <span class="Constant"> +done-adding-backspace-operation</span> @@ -1670,8 +1670,8 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } anchor:address:duplex-list:character<span class="Special"> <- </span>get *deletion, <span class="Constant">delete-from:offset</span> <span class="muControl">break-unless</span> anchor deleted:address:duplex-list:character<span class="Special"> <- </span>get *deletion, <span class="Constant">deleted-text:offset</span> - old-cursor:address:duplex-list:character<span class="Special"> <- </span>last-duplex deleted - insert-duplex-range anchor, deleted + old-cursor:address:duplex-list:character<span class="Special"> <- </span>last deleted + insert-range anchor, deleted <span class="Comment"># assert cursor-row/cursor-column/top-of-screen match after-row/after-column/after-top-of-screen</span> *before-cursor<span class="Special"> <- </span>copy old-cursor *cursor-row<span class="Special"> <- </span>get *deletion, <span class="Constant">before-row:offset</span> @@ -1687,7 +1687,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="muControl">break-unless</span> deletion start:address:duplex-list:character<span class="Special"> <- </span>get *deletion, <span class="Constant">delete-from:offset</span> end:address:duplex-list:character<span class="Special"> <- </span>get *deletion, <span class="Constant">delete-until:offset</span> - remove-duplex-between start, end + remove-between start, end <span class="Comment"># assert cursor-row/cursor-column/top-of-screen match after-row/after-column/after-top-of-screen</span> *cursor-row<span class="Special"> <- </span>get *deletion, <span class="Constant">after-row:offset</span> *cursor-column<span class="Special"> <- </span>get *deletion, <span class="Constant">after-column:offset</span> @@ -1863,9 +1863,9 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } coalesce?:boolean<span class="Special"> <- </span>equal previous-coalesce-tag, <span class="Constant">2/coalesce-delete</span> <span class="muControl">break-unless</span> coalesce? delete-until:address:address:duplex-list:character<span class="Special"> <- </span>get-address *deletion, <span class="Constant">delete-until:offset</span> - *delete-until<span class="Special"> <- </span>next-duplex *before-cursor + *delete-until<span class="Special"> <- </span>next *before-cursor deleted-so-far:address:address:duplex-list:character<span class="Special"> <- </span>get-address *deletion, <span class="Constant">deleted-text:offset</span> - *deleted-so-far<span class="Special"> <- </span>append-duplex *deleted-so-far, deleted-cell + *deleted-so-far<span class="Special"> <- </span>append *deleted-so-far, deleted-cell after-row:address:number<span class="Special"> <- </span>get-address *deletion, <span class="Constant">after-row:offset</span> *after-row<span class="Special"> <- </span>copy *cursor-row after-column:address:number<span class="Special"> <- </span>get-address *deletion, <span class="Constant">after-column:offset</span> @@ -1876,7 +1876,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Delimiter">}</span> <span class="Comment"># if not, create a new operation</span> op:address:operation<span class="Special"> <- </span>new <span class="Constant">operation:type</span> - deleted-until:address:duplex-list:character<span class="Special"> <- </span>next-duplex *before-cursor + deleted-until:address:duplex-list:character<span class="Special"> <- </span>next *before-cursor *op<span class="Special"> <- </span>merge <span class="Constant">2/delete-operation</span>, save-row/<span class="muRecipe">before</span>, save-column/<span class="muRecipe">before</span>, top-before, *cursor-row/<span class="muRecipe">after</span>, *cursor-column/<span class="muRecipe">after</span>, top-after, deleted-cell/deleted, *before-cursor/delete-from, deleted-until, <span class="Constant">2/coalesce-delete</span> editor<span class="Special"> <- </span>add-operation editor, op <span class="Constant"> +done-adding-delete-operation</span> @@ -1977,7 +1977,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } top-after:address:duplex-list:character<span class="Special"> <- </span>get *editor, <span class="Constant">top-of-screen:offset</span> undo:address:address:list:address:operation<span class="Special"> <- </span>get-address *editor, <span class="Constant">undo:offset</span> op:address:operation<span class="Special"> <- </span>new <span class="Constant">operation:type</span> - deleted-until:address:duplex-list:character<span class="Special"> <- </span>next-duplex *before-cursor + deleted-until:address:duplex-list:character<span class="Special"> <- </span>next *before-cursor *op<span class="Special"> <- </span>merge <span class="Constant">2/delete-operation</span>, save-row/<span class="muRecipe">before</span>, save-column/<span class="muRecipe">before</span>, top-before, *cursor-row/<span class="muRecipe">after</span>, *cursor-column/<span class="muRecipe">after</span>, top-after, deleted-cells/deleted, *before-cursor/delete-from, deleted-until, <span class="Constant">0/never-coalesce</span> editor<span class="Special"> <- </span>add-operation editor, op <span class="Constant"> +done-adding-delete-operation</span> @@ -2078,7 +2078,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } top-after:address:duplex-list:character<span class="Special"> <- </span>get *editor, <span class="Constant">top-of-screen:offset</span> undo:address:address:list:address:operation<span class="Special"> <- </span>get-address *editor, <span class="Constant">undo:offset</span> op:address:operation<span class="Special"> <- </span>new <span class="Constant">operation:type</span> - deleted-until:address:duplex-list:character<span class="Special"> <- </span>next-duplex *before-cursor + deleted-until:address:duplex-list:character<span class="Special"> <- </span>next *before-cursor *op<span class="Special"> <- </span>merge <span class="Constant">2/delete-operation</span>, save-row/<span class="muRecipe">before</span>, save-column/<span class="muRecipe">before</span>, top-before, *cursor-row/<span class="muRecipe">after</span>, *cursor-column/<span class="muRecipe">after</span>, top-after, deleted-cells/deleted, *before-cursor/delete-from, deleted-until, <span class="Constant">0/never-coalesce</span> editor<span class="Special"> <- </span>add-operation editor, op <span class="Constant"> +done-adding-delete-operation</span> |