diff options
Diffstat (limited to 'html/edit/012-editor-undo.mu.html')
-rw-r--r-- | html/edit/012-editor-undo.mu.html | 144 |
1 files changed, 72 insertions, 72 deletions
diff --git a/html/edit/012-editor-undo.mu.html b/html/edit/012-editor-undo.mu.html index bf1b7c99..2c227c0f 100644 --- a/html/edit/012-editor-undo.mu.html +++ b/html/edit/012-editor-undo.mu.html @@ -74,13 +74,13 @@ if ('onhashchange' in window) { <span id="L11" class="LineNr"> 11 </span><span class="muData">container</span> <a href='012-editor-undo.mu.html#L11'>insert-operation</a> [ <span id="L12" class="LineNr"> 12 </span> before-row:num <span id="L13" class="LineNr"> 13 </span> before-column:num -<span id="L14" class="LineNr"> 14 </span> before-top-of-screen:&:duplex-list:char +<span id="L14" class="LineNr"> 14 </span> before-top-of-screen:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span id="L15" class="LineNr"> 15 </span> after-row:num <span id="L16" class="LineNr"> 16 </span> after-column:num -<span id="L17" class="LineNr"> 17 </span> after-top-of-screen:&:duplex-list:char +<span id="L17" class="LineNr"> 17 </span> after-top-of-screen:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span id="L18" class="LineNr"> 18 </span> <span class="Comment"># inserted text is from 'insert-from' until 'insert-until'; list doesn't have to terminate</span> -<span id="L19" class="LineNr"> 19 </span> insert-from:&:duplex-list:char -<span id="L20" class="LineNr"> 20 </span> insert-until:&:duplex-list:char +<span id="L19" class="LineNr"> 19 </span> insert-from:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char +<span id="L20" class="LineNr"> 20 </span> insert-until:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span id="L21" class="LineNr"> 21 </span> tag:num <span class="Comment"># event causing this operation; might be used to coalesce runs of similar events</span> <span id="L22" class="LineNr"> 22 </span> <span class="Conceal">¦</span> <span class="Comment"># 0: no coalesce (enter+indent)</span> <span id="L23" class="LineNr"> 23 </span> <span class="Conceal">¦</span> <span class="Comment"># 1: regular alphanumeric characters</span> @@ -89,10 +89,10 @@ if ('onhashchange' in window) { <span id="L26" class="LineNr"> 26 </span><span class="muData">container</span> <a href='012-editor-undo.mu.html#L26'>move-operation</a> [ <span id="L27" class="LineNr"> 27 </span> before-row:num <span id="L28" class="LineNr"> 28 </span> before-column:num -<span id="L29" class="LineNr"> 29 </span> before-top-of-screen:&:duplex-list:char +<span id="L29" class="LineNr"> 29 </span> before-top-of-screen:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span id="L30" class="LineNr"> 30 </span> after-row:num <span id="L31" class="LineNr"> 31 </span> after-column:num -<span id="L32" class="LineNr"> 32 </span> after-top-of-screen:&:duplex-list:char +<span id="L32" class="LineNr"> 32 </span> after-top-of-screen:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span id="L33" class="LineNr"> 33 </span> tag:num <span class="Comment"># event causing this operation; might be used to coalesce runs of similar events</span> <span id="L34" class="LineNr"> 34 </span> <span class="Conceal">¦</span> <span class="Comment"># 0: no coalesce (touch events, etc)</span> <span id="L35" class="LineNr"> 35 </span> <span class="Conceal">¦</span> <span class="Comment"># 1: left arrow</span> @@ -104,13 +104,13 @@ if ('onhashchange' in window) { <span id="L41" class="LineNr"> 41 </span><span class="muData">container</span> <a href='012-editor-undo.mu.html#L41'>delete-operation</a> [ <span id="L42" class="LineNr"> 42 </span> before-row:num <span id="L43" class="LineNr"> 43 </span> before-column:num -<span id="L44" class="LineNr"> 44 </span> before-top-of-screen:&:duplex-list:char +<span id="L44" class="LineNr"> 44 </span> before-top-of-screen:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span id="L45" class="LineNr"> 45 </span> after-row:num <span id="L46" class="LineNr"> 46 </span> after-column:num -<span id="L47" class="LineNr"> 47 </span> after-top-of-screen:&:duplex-list:char -<span id="L48" class="LineNr"> 48 </span> deleted-text:&:duplex-list:char -<span id="L49" class="LineNr"> 49 </span> delete-from:&:duplex-list:char -<span id="L50" class="LineNr"> 50 </span> delete-until:&:duplex-list:char +<span id="L47" class="LineNr"> 47 </span> after-top-of-screen:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char +<span id="L48" class="LineNr"> 48 </span> deleted-text:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char +<span id="L49" class="LineNr"> 49 </span> delete-from:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char +<span id="L50" class="LineNr"> 50 </span> delete-until:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span id="L51" class="LineNr"> 51 </span> tag:num <span class="Comment"># event causing this operation; might be used to coalesce runs of similar events</span> <span id="L52" class="LineNr"> 52 </span> <span class="Conceal">¦</span> <span class="Comment"># 0: no coalesce (ctrl-k, ctrl-u)</span> <span id="L53" class="LineNr"> 53 </span> <span class="Conceal">¦</span> <span class="Comment"># 1: backspace</span> @@ -119,8 +119,8 @@ if ('onhashchange' in window) { <span id="L56" class="LineNr"> 56 </span> <span id="L57" class="LineNr"> 57 </span><span class="Comment"># every editor accumulates a list of operations to undo/redo</span> <span id="L58" class="LineNr"> 58 </span><span class="muData">container</span> editor [ -<span id="L59" class="LineNr"> 59 </span> undo:&:list:&:<a href='012-editor-undo.mu.html#L5'>operation</a> -<span id="L60" class="LineNr"> 60 </span> redo:&:list:&:<a href='012-editor-undo.mu.html#L5'>operation</a> +<span id="L59" class="LineNr"> 59 </span> undo:&:<a href='../064list.mu.html#L6'>list</a>:&:<a href='012-editor-undo.mu.html#L5'>operation</a> +<span id="L60" class="LineNr"> 60 </span> redo:&:<a href='../064list.mu.html#L6'>list</a>:&:<a href='012-editor-undo.mu.html#L5'>operation</a> <span id="L61" class="LineNr"> 61 </span>] <span id="L62" class="LineNr"> 62 </span> <span id="L63" class="LineNr"> 63 </span><span class="Comment"># ctrl-z - undo operation</span> @@ -128,12 +128,12 @@ if ('onhashchange' in window) { <span id="L65" class="LineNr"> 65 </span> <span class="Delimiter">{</span> <span id="L66" class="LineNr"> 66 </span> <span class="Conceal">¦</span> undo?:bool <span class="Special"><-</span> equal c, <span class="Constant">26/ctrl-z</span> <span id="L67" class="LineNr"> 67 </span> <span class="Conceal">¦</span> <span class="muControl">break-unless</span> undo? -<span id="L68" class="LineNr"> 68 </span> <span class="Conceal">¦</span> undo:&:list:&:<a href='012-editor-undo.mu.html#L5'>operation</a> <span class="Special"><-</span> get *editor, <span class="Constant">undo:offset</span> +<span id="L68" class="LineNr"> 68 </span> <span class="Conceal">¦</span> undo:&:<a href='../064list.mu.html#L6'>list</a>:&:<a href='012-editor-undo.mu.html#L5'>operation</a> <span class="Special"><-</span> get *editor, <span class="Constant">undo:offset</span> <span id="L69" class="LineNr"> 69 </span> <span class="Conceal">¦</span> <span class="muControl">break-unless</span> undo <span id="L70" class="LineNr"> 70 </span> <span class="Conceal">¦</span> op:&:<a href='012-editor-undo.mu.html#L5'>operation</a> <span class="Special"><-</span> first undo <span id="L71" class="LineNr"> 71 </span> <span class="Conceal">¦</span> undo <span class="Special"><-</span> <a href='../064list.mu.html#L25'>rest</a> undo <span id="L72" class="LineNr"> 72 </span> <span class="Conceal">¦</span> *editor <span class="Special"><-</span> put *editor, <span class="Constant">undo:offset</span>, undo -<span id="L73" class="LineNr"> 73 </span> <span class="Conceal">¦</span> redo:&:list:&:<a href='012-editor-undo.mu.html#L5'>operation</a> <span class="Special"><-</span> get *editor, <span class="Constant">redo:offset</span> +<span id="L73" class="LineNr"> 73 </span> <span class="Conceal">¦</span> redo:&:<a href='../064list.mu.html#L6'>list</a>:&:<a href='012-editor-undo.mu.html#L5'>operation</a> <span class="Special"><-</span> get *editor, <span class="Constant">redo:offset</span> <span id="L74" class="LineNr"> 74 </span> <span class="Conceal">¦</span> redo <span class="Special"><-</span> push op, redo <span id="L75" class="LineNr"> 75 </span> <span class="Conceal">¦</span> *editor <span class="Special"><-</span> put *editor, <span class="Constant">redo:offset</span>, redo <span id="L76" class="LineNr"> 76 </span><span class="Constant"> </span><span class="Conceal">¦</span><span class="Constant"> <a href='012-editor-undo.mu.html#L76'><handle-undo></a></span> @@ -146,12 +146,12 @@ if ('onhashchange' in window) { <span id="L83" class="LineNr"> 83 </span> <span class="Delimiter">{</span> <span id="L84" class="LineNr"> 84 </span> <span class="Conceal">¦</span> redo?:bool <span class="Special"><-</span> equal c, <span class="Constant">25/ctrl-y</span> <span id="L85" class="LineNr"> 85 </span> <span class="Conceal">¦</span> <span class="muControl">break-unless</span> redo? -<span id="L86" class="LineNr"> 86 </span> <span class="Conceal">¦</span> redo:&:list:&:<a href='012-editor-undo.mu.html#L5'>operation</a> <span class="Special"><-</span> get *editor, <span class="Constant">redo:offset</span> +<span id="L86" class="LineNr"> 86 </span> <span class="Conceal">¦</span> redo:&:<a href='../064list.mu.html#L6'>list</a>:&:<a href='012-editor-undo.mu.html#L5'>operation</a> <span class="Special"><-</span> get *editor, <span class="Constant">redo:offset</span> <span id="L87" class="LineNr"> 87 </span> <span class="Conceal">¦</span> <span class="muControl">break-unless</span> redo <span id="L88" class="LineNr"> 88 </span> <span class="Conceal">¦</span> op:&:<a href='012-editor-undo.mu.html#L5'>operation</a> <span class="Special"><-</span> first redo <span id="L89" class="LineNr"> 89 </span> <span class="Conceal">¦</span> redo <span class="Special"><-</span> <a href='../064list.mu.html#L25'>rest</a> redo <span id="L90" class="LineNr"> 90 </span> <span class="Conceal">¦</span> *editor <span class="Special"><-</span> put *editor, <span class="Constant">redo:offset</span>, redo -<span id="L91" class="LineNr"> 91 </span> <span class="Conceal">¦</span> undo:&:list:&:<a href='012-editor-undo.mu.html#L5'>operation</a> <span class="Special"><-</span> get *editor, <span class="Constant">undo:offset</span> +<span id="L91" class="LineNr"> 91 </span> <span class="Conceal">¦</span> undo:&:<a href='../064list.mu.html#L6'>list</a>:&:<a href='012-editor-undo.mu.html#L5'>operation</a> <span class="Special"><-</span> get *editor, <span class="Constant">undo:offset</span> <span id="L92" class="LineNr"> 92 </span> <span class="Conceal">¦</span> undo <span class="Special"><-</span> push op, undo <span id="L93" class="LineNr"> 93 </span> <span class="Conceal">¦</span> *editor <span class="Special"><-</span> put *editor, <span class="Constant">undo:offset</span>, undo <span id="L94" class="LineNr"> 94 </span><span class="Constant"> </span><span class="Conceal">¦</span><span class="Constant"> <a href='012-editor-undo.mu.html#L94'><handle-redo></a></span> @@ -202,14 +202,14 @@ if ('onhashchange' in window) { <span id="L139" class="LineNr"> 139 </span> <span id="L140" class="LineNr"> 140 </span><span class="Comment"># save operation to undo</span> <span id="L141" class="LineNr"> 141 </span><span class="muRecipe">after</span> <span class="Constant"><insert-character-begin></span> [ -<span id="L142" class="LineNr"> 142 </span> top-before:&:duplex-list:char <span class="Special"><-</span> get *editor, <span class="Constant">top-of-screen:offset</span> -<span id="L143" class="LineNr"> 143 </span> cursor-before:&:duplex-list:char <span class="Special"><-</span> get *editor, <span class="Constant">before-cursor:offset</span> +<span id="L142" class="LineNr"> 142 </span> top-before:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get *editor, <span class="Constant">top-of-screen:offset</span> +<span id="L143" class="LineNr"> 143 </span> cursor-before:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get *editor, <span class="Constant">before-cursor:offset</span> <span id="L144" class="LineNr"> 144 </span>] <span id="L145" class="LineNr"> 145 </span><span class="muRecipe">before</span> <span class="Constant"><insert-character-end></span> [ -<span id="L146" class="LineNr"> 146 </span> top-after:&:duplex-list:char <span class="Special"><-</span> get *editor, <span class="Constant">top-of-screen:offset</span> +<span id="L146" class="LineNr"> 146 </span> top-after:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get *editor, <span class="Constant">top-of-screen:offset</span> <span id="L147" class="LineNr"> 147 </span> cursor-row:num <span class="Special"><-</span> get *editor, <span class="Constant">cursor-row:offset</span> <span id="L148" class="LineNr"> 148 </span> cursor-column:num <span class="Special"><-</span> get *editor, <span class="Constant">cursor-column:offset</span> -<span id="L149" class="LineNr"> 149 </span> undo:&:list:&:<a href='012-editor-undo.mu.html#L5'>operation</a> <span class="Special"><-</span> get *editor, <span class="Constant">undo:offset</span> +<span id="L149" class="LineNr"> 149 </span> undo:&:<a href='../064list.mu.html#L6'>list</a>:&:<a href='012-editor-undo.mu.html#L5'>operation</a> <span class="Special"><-</span> get *editor, <span class="Constant">undo:offset</span> <span id="L150" class="LineNr"> 150 </span> <span class="Delimiter">{</span> <span id="L151" class="LineNr"> 151 </span> <span class="Conceal">¦</span> <span class="Comment"># if previous operation was an insert, coalesce this operation with it</span> <span id="L152" class="LineNr"> 152 </span> <span class="Conceal">¦</span> <span class="muControl">break-unless</span> undo @@ -218,8 +218,8 @@ if ('onhashchange' in window) { <span id="L155" class="LineNr"> 155 </span> <span class="Conceal">¦</span> <span class="muControl">break-unless</span> is-insert? <span id="L156" class="LineNr"> 156 </span> <span class="Conceal">¦</span> previous-coalesce-tag:num <span class="Special"><-</span> get typing, <span class="Constant">tag:offset</span> <span id="L157" class="LineNr"> 157 </span> <span class="Conceal">¦</span> <span class="muControl">break-unless</span> previous-coalesce-tag -<span id="L158" class="LineNr"> 158 </span> <span class="Conceal">¦</span> before-cursor:&:duplex-list:char <span class="Special"><-</span> get *editor, <span class="Constant">before-cursor:offset</span> -<span id="L159" class="LineNr"> 159 </span> <span class="Conceal">¦</span> insert-until:&:duplex-list:char <span class="Special"><-</span> <a href='../065duplex_list.mu.html#L29'>next</a> before-cursor +<span id="L158" class="LineNr"> 158 </span> <span class="Conceal">¦</span> before-cursor:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get *editor, <span class="Constant">before-cursor:offset</span> +<span id="L159" class="LineNr"> 159 </span> <span class="Conceal">¦</span> insert-until:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> <a href='../065duplex_list.mu.html#L29'>next</a> before-cursor <span id="L160" class="LineNr"> 160 </span> <span class="Conceal">¦</span> typing <span class="Special"><-</span> put typing, <span class="Constant">insert-until:offset</span>, insert-until <span id="L161" class="LineNr"> 161 </span> <span class="Conceal">¦</span> typing <span class="Special"><-</span> put typing, <span class="Constant">after-row:offset</span>, cursor-row <span id="L162" class="LineNr"> 162 </span> <span class="Conceal">¦</span> typing <span class="Special"><-</span> put typing, <span class="Constant">after-column:offset</span>, cursor-column @@ -228,8 +228,8 @@ if ('onhashchange' in window) { <span id="L165" class="LineNr"> 165 </span> <span class="Conceal">¦</span> <span class="muControl">break</span> <span class="Constant">+done-adding-insert-operation</span> <span id="L166" class="LineNr"> 166 </span> <span class="Delimiter">}</span> <span id="L167" class="LineNr"> 167 </span> <span class="Comment"># if not, create a new operation</span> -<span id="L168" class="LineNr"> 168 </span> insert-from:&:duplex-list:char <span class="Special"><-</span> <a href='../065duplex_list.mu.html#L29'>next</a> cursor-before -<span id="L169" class="LineNr"> 169 </span> insert-to:&:duplex-list:char <span class="Special"><-</span> <a href='../065duplex_list.mu.html#L29'>next</a> insert-from +<span id="L168" class="LineNr"> 168 </span> insert-from:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> <a href='../065duplex_list.mu.html#L29'>next</a> cursor-before +<span id="L169" class="LineNr"> 169 </span> insert-to:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> <a href='../065duplex_list.mu.html#L29'>next</a> insert-from <span id="L170" class="LineNr"> 170 </span> op:&:<a href='012-editor-undo.mu.html#L5'>operation</a> <span class="Special"><-</span> new <span class="Constant"><a href='012-editor-undo.mu.html#L5'>operation</a>:type</span> <span id="L171" class="LineNr"> 171 </span> *op <span class="Special"><-</span> merge <span class="Constant">0/insert-operation</span>, save-row/before, save-column/before, top-before, cursor-row/after, cursor-column/after, top-after, insert-from, insert-to, <span class="Constant">1/coalesce</span> <span id="L172" class="LineNr"> 172 </span> editor <span class="Special"><-</span> <a href='012-editor-undo.mu.html#L200'>add-operation</a> editor, op @@ -240,17 +240,17 @@ if ('onhashchange' in window) { <span id="L177" class="LineNr"> 177 </span><span class="muRecipe">after</span> <span class="Constant"><a href='002-typing.mu.html#L857'><insert-enter-begin></a></span> [ <span id="L178" class="LineNr"> 178 </span> cursor-row-before:num <span class="Special"><-</span> copy cursor-row <span id="L179" class="LineNr"> 179 </span> cursor-column-before:num <span class="Special"><-</span> copy cursor-column -<span id="L180" class="LineNr"> 180 </span> top-before:&:duplex-list:char <span class="Special"><-</span> get *editor, <span class="Constant">top-of-screen:offset</span> -<span id="L181" class="LineNr"> 181 </span> cursor-before:&:duplex-list:char <span class="Special"><-</span> get *editor, <span class="Constant">before-cursor:offset</span> +<span id="L180" class="LineNr"> 180 </span> top-before:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get *editor, <span class="Constant">top-of-screen:offset</span> +<span id="L181" class="LineNr"> 181 </span> cursor-before:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get *editor, <span class="Constant">before-cursor:offset</span> <span id="L182" class="LineNr"> 182 </span>] <span id="L183" class="LineNr"> 183 </span><span class="muRecipe">before</span> <span class="Constant"><a href='002-typing.mu.html#L859'><insert-enter-end></a></span> [ -<span id="L184" class="LineNr"> 184 </span> top-after:&:duplex-list:char <span class="Special"><-</span> get *editor, <span class="Constant">top-of-screen:offset</span> +<span id="L184" class="LineNr"> 184 </span> top-after:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get *editor, <span class="Constant">top-of-screen:offset</span> <span id="L185" class="LineNr"> 185 </span> cursor-row:num <span class="Special"><-</span> get *editor, <span class="Constant">cursor-row:offset</span> <span id="L186" class="LineNr"> 186 </span> cursor-column:num <span class="Special"><-</span> get *editor, <span class="Constant">cursor-row:offset</span> <span id="L187" class="LineNr"> 187 </span> <span class="Comment"># never coalesce</span> -<span id="L188" class="LineNr"> 188 </span> insert-from:&:duplex-list:char <span class="Special"><-</span> <a href='../065duplex_list.mu.html#L29'>next</a> cursor-before -<span id="L189" class="LineNr"> 189 </span> before-cursor:&:duplex-list:char <span class="Special"><-</span> get *editor, <span class="Constant">before-cursor:offset</span> -<span id="L190" class="LineNr"> 190 </span> insert-to:&:duplex-list:char <span class="Special"><-</span> <a href='../065duplex_list.mu.html#L29'>next</a> before-cursor +<span id="L188" class="LineNr"> 188 </span> insert-from:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> <a href='../065duplex_list.mu.html#L29'>next</a> cursor-before +<span id="L189" class="LineNr"> 189 </span> before-cursor:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get *editor, <span class="Constant">before-cursor:offset</span> +<span id="L190" class="LineNr"> 190 </span> insert-to:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> <a href='../065duplex_list.mu.html#L29'>next</a> before-cursor <span id="L191" class="LineNr"> 191 </span> op:&:<a href='012-editor-undo.mu.html#L5'>operation</a> <span class="Special"><-</span> new <span class="Constant"><a href='012-editor-undo.mu.html#L5'>operation</a>:type</span> <span id="L192" class="LineNr"> 192 </span> *op <span class="Special"><-</span> merge <span class="Constant">0/insert-operation</span>, cursor-row-before, cursor-column-before, top-before, cursor-row/after, cursor-column/after, top-after, insert-from, insert-to, <span class="Constant">0/never-coalesce</span> <span id="L193" class="LineNr"> 193 </span> editor <span class="Special"><-</span> <a href='012-editor-undo.mu.html#L200'>add-operation</a> editor, op @@ -263,10 +263,10 @@ if ('onhashchange' in window) { <span id="L200" class="LineNr"> 200 </span><span class="muRecipe">def</span> <a href='012-editor-undo.mu.html#L200'>add-operation</a> editor:&:editor, op:&:<a href='012-editor-undo.mu.html#L5'>operation</a><span class="muRecipe"> -> </span>editor:&:editor [ <span id="L201" class="LineNr"> 201 </span> <span class="Constant">local-scope</span> <span id="L202" class="LineNr"> 202 </span> <span class="Constant">load-ingredients</span> -<span id="L203" class="LineNr"> 203 </span> undo:&:list:&:<a href='012-editor-undo.mu.html#L5'>operation</a> <span class="Special"><-</span> get *editor, <span class="Constant">undo:offset</span> +<span id="L203" class="LineNr"> 203 </span> undo:&:<a href='../064list.mu.html#L6'>list</a>:&:<a href='012-editor-undo.mu.html#L5'>operation</a> <span class="Special"><-</span> get *editor, <span class="Constant">undo:offset</span> <span id="L204" class="LineNr"> 204 </span> undo <span class="Special"><-</span> push op undo <span id="L205" class="LineNr"> 205 </span> *editor <span class="Special"><-</span> put *editor, <span class="Constant">undo:offset</span>, undo -<span id="L206" class="LineNr"> 206 </span> redo:&:list:&:<a href='012-editor-undo.mu.html#L5'>operation</a> <span class="Special"><-</span> get *editor, <span class="Constant">redo:offset</span> +<span id="L206" class="LineNr"> 206 </span> redo:&:<a href='../064list.mu.html#L6'>list</a>:&:<a href='012-editor-undo.mu.html#L5'>operation</a> <span class="Special"><-</span> get *editor, <span class="Constant">redo:offset</span> <span id="L207" class="LineNr"> 207 </span> redo <span class="Special"><-</span> copy<span class="Constant"> 0</span> <span id="L208" class="LineNr"> 208 </span> *editor <span class="Special"><-</span> put *editor, <span class="Constant">redo:offset</span>, redo <span id="L209" class="LineNr"> 209 </span>] @@ -275,17 +275,17 @@ if ('onhashchange' in window) { <span id="L212" class="LineNr"> 212 </span> <span class="Delimiter">{</span> <span id="L213" class="LineNr"> 213 </span> <span class="Conceal">¦</span> typing:<a href='012-editor-undo.mu.html#L11'>insert-operation</a>, is-insert?:bool <span class="Special"><-</span> maybe-convert *op, <span class="Constant">typing:variant</span> <span id="L214" class="LineNr"> 214 </span> <span class="Conceal">¦</span> <span class="muControl">break-unless</span> is-insert? -<span id="L215" class="LineNr"> 215 </span> <span class="Conceal">¦</span> start:&:duplex-list:char <span class="Special"><-</span> get typing, <span class="Constant">insert-from:offset</span> -<span id="L216" class="LineNr"> 216 </span> <span class="Conceal">¦</span> end:&:duplex-list:char <span class="Special"><-</span> get typing, <span class="Constant">insert-until:offset</span> +<span id="L215" class="LineNr"> 215 </span> <span class="Conceal">¦</span> start:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get typing, <span class="Constant">insert-from:offset</span> +<span id="L216" class="LineNr"> 216 </span> <span class="Conceal">¦</span> end:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get typing, <span class="Constant">insert-until:offset</span> <span id="L217" class="LineNr"> 217 </span> <span class="Conceal">¦</span> <span class="Comment"># assert cursor-row/cursor-column/top-of-screen match after-row/after-column/after-top-of-screen</span> -<span id="L218" class="LineNr"> 218 </span> <span class="Conceal">¦</span> before-cursor:&:duplex-list:char <span class="Special"><-</span> <a href='../065duplex_list.mu.html#L36'>prev</a> start +<span id="L218" class="LineNr"> 218 </span> <span class="Conceal">¦</span> before-cursor:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> <a href='../065duplex_list.mu.html#L36'>prev</a> start <span id="L219" class="LineNr"> 219 </span> <span class="Conceal">¦</span> *editor <span class="Special"><-</span> put *editor, <span class="Constant">before-cursor:offset</span>, before-cursor <span id="L220" class="LineNr"> 220 </span> <span class="Conceal">¦</span> <a href='../065duplex_list.mu.html#L357'>remove-between</a> before-cursor, end <span id="L221" class="LineNr"> 221 </span> <span class="Conceal">¦</span> cursor-row <span class="Special"><-</span> get typing, <span class="Constant">before-row:offset</span> <span id="L222" class="LineNr"> 222 </span> <span class="Conceal">¦</span> *editor <span class="Special"><-</span> put *editor, <span class="Constant">cursor-row:offset</span>, cursor-row <span id="L223" class="LineNr"> 223 </span> <span class="Conceal">¦</span> cursor-column <span class="Special"><-</span> get typing, <span class="Constant">before-column:offset</span> <span id="L224" class="LineNr"> 224 </span> <span class="Conceal">¦</span> *editor <span class="Special"><-</span> put *editor, <span class="Constant">cursor-column:offset</span>, cursor-column -<span id="L225" class="LineNr"> 225 </span> <span class="Conceal">¦</span> top:&:duplex-list:char <span class="Special"><-</span> get typing, <span class="Constant">before-top-of-screen:offset</span> +<span id="L225" class="LineNr"> 225 </span> <span class="Conceal">¦</span> top:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get typing, <span class="Constant">before-top-of-screen:offset</span> <span id="L226" class="LineNr"> 226 </span> <span class="Conceal">¦</span> *editor <span class="Special"><-</span> put *editor, <span class="Constant">top-of-screen:offset</span>, top <span id="L227" class="LineNr"> 227 </span> <span class="Delimiter">}</span> <span id="L228" class="LineNr"> 228 </span>] @@ -476,7 +476,7 @@ if ('onhashchange' in window) { <span id="L413" class="LineNr"> 413 </span> <span class="Conceal">¦</span> typing:<a href='012-editor-undo.mu.html#L11'>insert-operation</a>, is-insert?:bool <span class="Special"><-</span> maybe-convert *op, <span class="Constant">typing:variant</span> <span id="L414" class="LineNr"> 414 </span> <span class="Conceal">¦</span> <span class="muControl">break-unless</span> is-insert? <span id="L415" class="LineNr"> 415 </span> <span class="Conceal">¦</span> before-cursor <span class="Special"><-</span> get *editor, <span class="Constant">before-cursor:offset</span> -<span id="L416" class="LineNr"> 416 </span> <span class="Conceal">¦</span> insert-from:&:duplex-list:char <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 id="L416" class="LineNr"> 416 </span> <span class="Conceal">¦</span> insert-from:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <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 id="L417" class="LineNr"> 417 </span> <span class="Conceal">¦</span> <span class="Comment"># assert insert-to matches next(before-cursor)</span> <span id="L418" class="LineNr"> 418 </span> <span class="Conceal">¦</span> <a href='../065duplex_list.mu.html#L497'>insert-range</a> before-cursor, insert-from <span id="L419" class="LineNr"> 419 </span> <span class="Conceal">¦</span> <span class="Comment"># assert cursor-row/cursor-column/top-of-screen match after-row/after-column/after-top-of-screen</span> @@ -484,7 +484,7 @@ if ('onhashchange' in window) { <span id="L421" class="LineNr"> 421 </span> <span class="Conceal">¦</span> *editor <span class="Special"><-</span> put *editor, <span class="Constant">cursor-row:offset</span>, cursor-row <span id="L422" class="LineNr"> 422 </span> <span class="Conceal">¦</span> cursor-column <span class="Special"><-</span> get typing, <span class="Constant">after-column:offset</span> <span id="L423" class="LineNr"> 423 </span> <span class="Conceal">¦</span> *editor <span class="Special"><-</span> put *editor, <span class="Constant">cursor-column:offset</span>, cursor-column -<span id="L424" class="LineNr"> 424 </span> <span class="Conceal">¦</span> top:&:duplex-list:char <span class="Special"><-</span> get typing, <span class="Constant">after-top-of-screen:offset</span> +<span id="L424" class="LineNr"> 424 </span> <span class="Conceal">¦</span> top:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get typing, <span class="Constant">after-top-of-screen:offset</span> <span id="L425" class="LineNr"> 425 </span> <span class="Conceal">¦</span> *editor <span class="Special"><-</span> put *editor, <span class="Constant">top-of-screen:offset</span>, top <span id="L426" class="LineNr"> 426 </span> <span class="Delimiter">}</span> <span id="L427" class="LineNr"> 427 </span>] @@ -782,17 +782,17 @@ if ('onhashchange' in window) { <span id="L719" class="LineNr"> 719 </span><span class="muRecipe">after</span> <span class="Constant"><move-cursor-begin></span> [ <span id="L720" class="LineNr"> 720 </span> cursor-row-before:num <span class="Special"><-</span> get *editor, <span class="Constant">cursor-row:offset</span> <span id="L721" class="LineNr"> 721 </span> cursor-column-before:num <span class="Special"><-</span> get *editor, <span class="Constant">cursor-column:offset</span> -<span id="L722" class="LineNr"> 722 </span> top-before:&:duplex-list:char <span class="Special"><-</span> get *editor, <span class="Constant">top-of-screen:offset</span> +<span id="L722" class="LineNr"> 722 </span> top-before:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get *editor, <span class="Constant">top-of-screen:offset</span> <span id="L723" class="LineNr"> 723 </span>] <span id="L724" class="LineNr"> 724 </span><span class="muRecipe">before</span> <span class="Constant"><move-cursor-end></span> [ -<span id="L725" class="LineNr"> 725 </span> top-after:&:duplex-list:char <span class="Special"><-</span> get *editor, <span class="Constant">top-of-screen:offset</span> +<span id="L725" class="LineNr"> 725 </span> top-after:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get *editor, <span class="Constant">top-of-screen:offset</span> <span id="L726" class="LineNr"> 726 </span> cursor-row:num <span class="Special"><-</span> get *editor, <span class="Constant">cursor-row:offset</span> <span id="L727" class="LineNr"> 727 </span> cursor-column:num <span class="Special"><-</span> get *editor, <span class="Constant">cursor-column:offset</span> <span id="L728" class="LineNr"> 728 </span> <span class="Delimiter">{</span> <span id="L729" class="LineNr"> 729 </span> <span class="Conceal">¦</span> <span class="muControl">break-unless</span> undo-coalesce-tag <span id="L730" class="LineNr"> 730 </span> <span class="Conceal">¦</span> <span class="Comment"># if previous operation was also a move, and also had the same coalesce</span> <span id="L731" class="LineNr"> 731 </span> <span class="Conceal">¦</span> <span class="Comment"># tag, coalesce with it</span> -<span id="L732" class="LineNr"> 732 </span> <span class="Conceal">¦</span> undo:&:list:&:<a href='012-editor-undo.mu.html#L5'>operation</a> <span class="Special"><-</span> get *editor, <span class="Constant">undo:offset</span> +<span id="L732" class="LineNr"> 732 </span> <span class="Conceal">¦</span> undo:&:<a href='../064list.mu.html#L6'>list</a>:&:<a href='012-editor-undo.mu.html#L5'>operation</a> <span class="Special"><-</span> get *editor, <span class="Constant">undo:offset</span> <span id="L733" class="LineNr"> 733 </span> <span class="Conceal">¦</span> <span class="muControl">break-unless</span> undo <span id="L734" class="LineNr"> 734 </span> <span class="Conceal">¦</span> op:&:<a href='012-editor-undo.mu.html#L5'>operation</a> <span class="Special"><-</span> first undo <span id="L735" class="LineNr"> 735 </span> <span class="Conceal">¦</span> move:<a href='012-editor-undo.mu.html#L26'>move-operation</a>, is-move?:bool <span class="Special"><-</span> maybe-convert *op, <span class="Constant">move:variant</span> @@ -821,7 +821,7 @@ if ('onhashchange' in window) { <span id="L758" class="LineNr"> 758 </span> <span class="Conceal">¦</span> *editor <span class="Special"><-</span> put *editor, <span class="Constant">cursor-row:offset</span>, cursor-row <span id="L759" class="LineNr"> 759 </span> <span class="Conceal">¦</span> cursor-column <span class="Special"><-</span> get move, <span class="Constant">before-column:offset</span> <span id="L760" class="LineNr"> 760 </span> <span class="Conceal">¦</span> *editor <span class="Special"><-</span> put *editor, <span class="Constant">cursor-column:offset</span>, cursor-column -<span id="L761" class="LineNr"> 761 </span> <span class="Conceal">¦</span> top:&:duplex-list:char <span class="Special"><-</span> get move, <span class="Constant">before-top-of-screen:offset</span> +<span id="L761" class="LineNr"> 761 </span> <span class="Conceal">¦</span> top:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get move, <span class="Constant">before-top-of-screen:offset</span> <span id="L762" class="LineNr"> 762 </span> <span class="Conceal">¦</span> *editor <span class="Special"><-</span> put *editor, <span class="Constant">top-of-screen:offset</span>, top <span id="L763" class="LineNr"> 763 </span> <span class="Delimiter">}</span> <span id="L764" class="LineNr"> 764 </span>] @@ -1457,7 +1457,7 @@ if ('onhashchange' in window) { <span id="L1394" class="LineNr">1394 </span> <span class="Conceal">¦</span> *editor <span class="Special"><-</span> put *editor, <span class="Constant">cursor-row:offset</span>, cursor-row <span id="L1395" class="LineNr">1395 </span> <span class="Conceal">¦</span> cursor-column <span class="Special"><-</span> get move, <span class="Constant">after-column:offset</span> <span id="L1396" class="LineNr">1396 </span> <span class="Conceal">¦</span> *editor <span class="Special"><-</span> put *editor, <span class="Constant">cursor-column:offset</span>, cursor-column -<span id="L1397" class="LineNr">1397 </span> <span class="Conceal">¦</span> top:&:duplex-list:char <span class="Special"><-</span> get move, <span class="Constant">after-top-of-screen:offset</span> +<span id="L1397" class="LineNr">1397 </span> <span class="Conceal">¦</span> top:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get move, <span class="Constant">after-top-of-screen:offset</span> <span id="L1398" class="LineNr">1398 </span> <span class="Conceal">¦</span> *editor <span class="Special"><-</span> put *editor, <span class="Constant">top-of-screen:offset</span>, top <span id="L1399" class="LineNr">1399 </span> <span class="Delimiter">}</span> <span id="L1400" class="LineNr">1400 </span>] @@ -1678,16 +1678,16 @@ if ('onhashchange' in window) { <span id="L1615" class="LineNr">1615 </span> <span id="L1616" class="LineNr">1616 </span><span class="Comment"># save operation to undo</span> <span id="L1617" class="LineNr">1617 </span><span class="muRecipe">after</span> <span class="Constant"><a href='003-shortcuts.mu.html#L73'><backspace-character-begin></a></span> [ -<span id="L1618" class="LineNr">1618 </span> top-before:&:duplex-list:char <span class="Special"><-</span> get *editor, <span class="Constant">top-of-screen:offset</span> +<span id="L1618" class="LineNr">1618 </span> top-before:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get *editor, <span class="Constant">top-of-screen:offset</span> <span id="L1619" class="LineNr">1619 </span>] <span id="L1620" class="LineNr">1620 </span><span class="muRecipe">before</span> <span class="Constant"><a href='003-shortcuts.mu.html#L75'><backspace-character-end></a></span> [ <span id="L1621" class="LineNr">1621 </span> <span class="Delimiter">{</span> <span id="L1622" class="LineNr">1622 </span> <span class="Conceal">¦</span> <span class="muControl">break-unless</span> backspaced-cell <span class="Comment"># backspace failed; don't add an undo operation</span> -<span id="L1623" class="LineNr">1623 </span> <span class="Conceal">¦</span> top-after:&:duplex-list:char <span class="Special"><-</span> get *editor, <span class="Constant">top-of-screen:offset</span> +<span id="L1623" class="LineNr">1623 </span> <span class="Conceal">¦</span> top-after:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get *editor, <span class="Constant">top-of-screen:offset</span> <span id="L1624" class="LineNr">1624 </span> <span class="Conceal">¦</span> cursor-row:num <span class="Special"><-</span> get *editor, <span class="Constant">cursor-row:offset</span> <span id="L1625" class="LineNr">1625 </span> <span class="Conceal">¦</span> cursor-column:num <span class="Special"><-</span> get *editor, <span class="Constant">cursor-row:offset</span> -<span id="L1626" class="LineNr">1626 </span> <span class="Conceal">¦</span> before-cursor:&:duplex-list:char <span class="Special"><-</span> get *editor, <span class="Constant">before-cursor:offset</span> -<span id="L1627" class="LineNr">1627 </span> <span class="Conceal">¦</span> undo:&:list:&:<a href='012-editor-undo.mu.html#L5'>operation</a> <span class="Special"><-</span> get *editor, <span class="Constant">undo:offset</span> +<span id="L1626" class="LineNr">1626 </span> <span class="Conceal">¦</span> before-cursor:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get *editor, <span class="Constant">before-cursor:offset</span> +<span id="L1627" class="LineNr">1627 </span> <span class="Conceal">¦</span> undo:&:<a href='../064list.mu.html#L6'>list</a>:&:<a href='012-editor-undo.mu.html#L5'>operation</a> <span class="Special"><-</span> get *editor, <span class="Constant">undo:offset</span> <span id="L1628" class="LineNr">1628 </span> <span class="Conceal">¦</span> <span class="Delimiter">{</span> <span id="L1629" class="LineNr">1629 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Comment"># if previous operation was an insert, coalesce this operation with it</span> <span id="L1630" class="LineNr">1630 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="muControl">break-unless</span> undo @@ -1698,7 +1698,7 @@ if ('onhashchange' in window) { <span id="L1635" class="LineNr">1635 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> coalesce?:bool <span class="Special"><-</span> equal previous-coalesce-tag, <span class="Constant">1/coalesce-backspace</span> <span id="L1636" class="LineNr">1636 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="muControl">break-unless</span> coalesce? <span id="L1637" class="LineNr">1637 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> deletion <span class="Special"><-</span> put deletion, <span class="Constant">delete-from:offset</span>, before-cursor -<span id="L1638" class="LineNr">1638 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> backspaced-so-far:&:duplex-list:char <span class="Special"><-</span> get deletion, <span class="Constant">deleted-text:offset</span> +<span id="L1638" class="LineNr">1638 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> backspaced-so-far:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get deletion, <span class="Constant">deleted-text:offset</span> <span id="L1639" class="LineNr">1639 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <a href='../065duplex_list.mu.html#L497'>insert-range</a> backspaced-cell, backspaced-so-far <span id="L1640" class="LineNr">1640 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> deletion <span class="Special"><-</span> put deletion, <span class="Constant">deleted-text:offset</span>, backspaced-cell <span id="L1641" class="LineNr">1641 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> deletion <span class="Special"><-</span> put deletion, <span class="Constant">after-row:offset</span>, cursor-row @@ -1709,7 +1709,7 @@ if ('onhashchange' in window) { <span id="L1646" class="LineNr">1646 </span> <span class="Conceal">¦</span> <span class="Delimiter">}</span> <span id="L1647" class="LineNr">1647 </span> <span class="Conceal">¦</span> <span class="Comment"># if not, create a new operation</span> <span id="L1648" class="LineNr">1648 </span> <span class="Conceal">¦</span> op:&:<a href='012-editor-undo.mu.html#L5'>operation</a> <span class="Special"><-</span> new <span class="Constant"><a href='012-editor-undo.mu.html#L5'>operation</a>:type</span> -<span id="L1649" class="LineNr">1649 </span> <span class="Conceal">¦</span> deleted-until:&:duplex-list:char <span class="Special"><-</span> <a href='../065duplex_list.mu.html#L29'>next</a> before-cursor +<span id="L1649" class="LineNr">1649 </span> <span class="Conceal">¦</span> deleted-until:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> <a href='../065duplex_list.mu.html#L29'>next</a> before-cursor <span id="L1650" class="LineNr">1650 </span> <span class="Conceal">¦</span> *op <span class="Special"><-</span> merge <span class="Constant">2/delete-operation</span>, save-row/before, save-column/before, top-before, cursor-row/after, cursor-column/after, top-after, backspaced-cell/deleted, before-cursor/delete-from, deleted-until, <span class="Constant">1/coalesce-backspace</span> <span id="L1651" class="LineNr">1651 </span> <span class="Conceal">¦</span> editor <span class="Special"><-</span> <a href='012-editor-undo.mu.html#L200'>add-operation</a> editor, op <span id="L1652" class="LineNr">1652 </span><span class="Constant"> </span><span class="Conceal">¦</span><span class="Constant"> +done-adding-backspace-operation</span> @@ -1720,10 +1720,10 @@ if ('onhashchange' in window) { <span id="L1657" class="LineNr">1657 </span> <span class="Delimiter">{</span> <span id="L1658" class="LineNr">1658 </span> <span class="Conceal">¦</span> deletion:<a href='012-editor-undo.mu.html#L41'>delete-operation</a>, is-delete?:bool <span class="Special"><-</span> maybe-convert *op, <span class="Constant">delete:variant</span> <span id="L1659" class="LineNr">1659 </span> <span class="Conceal">¦</span> <span class="muControl">break-unless</span> is-delete? -<span id="L1660" class="LineNr">1660 </span> <span class="Conceal">¦</span> anchor:&:duplex-list:char <span class="Special"><-</span> get deletion, <span class="Constant">delete-from:offset</span> +<span id="L1660" class="LineNr">1660 </span> <span class="Conceal">¦</span> anchor:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get deletion, <span class="Constant">delete-from:offset</span> <span id="L1661" class="LineNr">1661 </span> <span class="Conceal">¦</span> <span class="muControl">break-unless</span> anchor -<span id="L1662" class="LineNr">1662 </span> <span class="Conceal">¦</span> deleted:&:duplex-list:char <span class="Special"><-</span> get deletion, <span class="Constant">deleted-text:offset</span> -<span id="L1663" class="LineNr">1663 </span> <span class="Conceal">¦</span> old-cursor:&:duplex-list:char <span class="Special"><-</span> <a href='../065duplex_list.mu.html#L528'>last</a> deleted +<span id="L1662" class="LineNr">1662 </span> <span class="Conceal">¦</span> deleted:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get deletion, <span class="Constant">deleted-text:offset</span> +<span id="L1663" class="LineNr">1663 </span> <span class="Conceal">¦</span> old-cursor:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> <a href='../065duplex_list.mu.html#L528'>last</a> deleted <span id="L1664" class="LineNr">1664 </span> <span class="Conceal">¦</span> <a href='../065duplex_list.mu.html#L497'>insert-range</a> anchor, deleted <span id="L1665" class="LineNr">1665 </span> <span class="Conceal">¦</span> <span class="Comment"># assert cursor-row/cursor-column/top-of-screen match after-row/after-column/after-top-of-screen</span> <span id="L1666" class="LineNr">1666 </span> <span class="Conceal">¦</span> before-cursor <span class="Special"><-</span> copy old-cursor @@ -1731,7 +1731,7 @@ if ('onhashchange' in window) { <span id="L1668" class="LineNr">1668 </span> <span class="Conceal">¦</span> *editor <span class="Special"><-</span> put *editor, <span class="Constant">cursor-row:offset</span>, cursor-row <span id="L1669" class="LineNr">1669 </span> <span class="Conceal">¦</span> cursor-column <span class="Special"><-</span> get deletion, <span class="Constant">before-column:offset</span> <span id="L1670" class="LineNr">1670 </span> <span class="Conceal">¦</span> *editor <span class="Special"><-</span> put *editor, <span class="Constant">cursor-column:offset</span>, cursor-column -<span id="L1671" class="LineNr">1671 </span> <span class="Conceal">¦</span> top:&:duplex-list:char <span class="Special"><-</span> get deletion, <span class="Constant">before-top-of-screen:offset</span> +<span id="L1671" class="LineNr">1671 </span> <span class="Conceal">¦</span> top:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get deletion, <span class="Constant">before-top-of-screen:offset</span> <span id="L1672" class="LineNr">1672 </span> <span class="Conceal">¦</span> *editor <span class="Special"><-</span> put *editor, <span class="Constant">top-of-screen:offset</span>, top <span id="L1673" class="LineNr">1673 </span> <span class="Delimiter">}</span> <span id="L1674" class="LineNr">1674 </span>] @@ -1740,16 +1740,16 @@ if ('onhashchange' in window) { <span id="L1677" class="LineNr">1677 </span> <span class="Delimiter">{</span> <span id="L1678" class="LineNr">1678 </span> <span class="Conceal">¦</span> deletion:<a href='012-editor-undo.mu.html#L41'>delete-operation</a>, is-delete?:bool <span class="Special"><-</span> maybe-convert *op, <span class="Constant">delete:variant</span> <span id="L1679" class="LineNr">1679 </span> <span class="Conceal">¦</span> <span class="muControl">break-unless</span> is-delete? -<span id="L1680" class="LineNr">1680 </span> <span class="Conceal">¦</span> start:&:duplex-list:char <span class="Special"><-</span> get deletion, <span class="Constant">delete-from:offset</span> -<span id="L1681" class="LineNr">1681 </span> <span class="Conceal">¦</span> end:&:duplex-list:char <span class="Special"><-</span> get deletion, <span class="Constant">delete-until:offset</span> -<span id="L1682" class="LineNr">1682 </span> <span class="Conceal">¦</span> data:&:duplex-list:char <span class="Special"><-</span> get *editor, <span class="Constant">data:offset</span> +<span id="L1680" class="LineNr">1680 </span> <span class="Conceal">¦</span> start:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get deletion, <span class="Constant">delete-from:offset</span> +<span id="L1681" class="LineNr">1681 </span> <span class="Conceal">¦</span> end:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get deletion, <span class="Constant">delete-until:offset</span> +<span id="L1682" class="LineNr">1682 </span> <span class="Conceal">¦</span> data:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get *editor, <span class="Constant">data:offset</span> <span id="L1683" class="LineNr">1683 </span> <span class="Conceal">¦</span> <a href='../065duplex_list.mu.html#L357'>remove-between</a> start, end <span id="L1684" class="LineNr">1684 </span> <span class="Conceal">¦</span> <span class="Comment"># assert cursor-row/cursor-column/top-of-screen match after-row/after-column/after-top-of-screen</span> <span id="L1685" class="LineNr">1685 </span> <span class="Conceal">¦</span> cursor-row <span class="Special"><-</span> get deletion, <span class="Constant">after-row:offset</span> <span id="L1686" class="LineNr">1686 </span> <span class="Conceal">¦</span> *editor <span class="Special"><-</span> put *editor, <span class="Constant">cursor-row:offset</span>, cursor-row <span id="L1687" class="LineNr">1687 </span> <span class="Conceal">¦</span> cursor-column <span class="Special"><-</span> get deletion, <span class="Constant">after-column:offset</span> <span id="L1688" class="LineNr">1688 </span> <span class="Conceal">¦</span> *editor <span class="Special"><-</span> put *editor, <span class="Constant">cursor-column:offset</span>, cursor-column -<span id="L1689" class="LineNr">1689 </span> <span class="Conceal">¦</span> top:&:duplex-list:char <span class="Special"><-</span> get deletion, <span class="Constant">before-top-of-screen:offset</span> +<span id="L1689" class="LineNr">1689 </span> <span class="Conceal">¦</span> top:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get deletion, <span class="Constant">before-top-of-screen:offset</span> <span id="L1690" class="LineNr">1690 </span> <span class="Conceal">¦</span> *editor <span class="Special"><-</span> put *editor, <span class="Constant">top-of-screen:offset</span>, top <span id="L1691" class="LineNr">1691 </span> <span class="Delimiter">}</span> <span id="L1692" class="LineNr">1692 </span>] @@ -1904,16 +1904,16 @@ if ('onhashchange' in window) { <span id="L1841" class="LineNr">1841 </span>] <span id="L1842" class="LineNr">1842 </span> <span id="L1843" class="LineNr">1843 </span><span class="muRecipe">after</span> <span class="Constant"><a href='003-shortcuts.mu.html#L341'><delete-character-begin></a></span> [ -<span id="L1844" class="LineNr">1844 </span> top-before:&:duplex-list:char <span class="Special"><-</span> get *editor, <span class="Constant">top-of-screen:offset</span> +<span id="L1844" class="LineNr">1844 </span> top-before:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get *editor, <span class="Constant">top-of-screen:offset</span> <span id="L1845" class="LineNr">1845 </span>] <span id="L1846" class="LineNr">1846 </span><span class="muRecipe">before</span> <span class="Constant"><a href='003-shortcuts.mu.html#L343'><delete-character-end></a></span> [ <span id="L1847" class="LineNr">1847 </span> <span class="Delimiter">{</span> <span id="L1848" class="LineNr">1848 </span> <span class="Conceal">¦</span> <span class="muControl">break-unless</span> deleted-cell <span class="Comment"># delete failed; don't add an undo operation</span> -<span id="L1849" class="LineNr">1849 </span> <span class="Conceal">¦</span> top-after:&:duplex-list:char <span class="Special"><-</span> get *editor, <span class="Constant">top-of-screen:offset</span> +<span id="L1849" class="LineNr">1849 </span> <span class="Conceal">¦</span> top-after:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get *editor, <span class="Constant">top-of-screen:offset</span> <span id="L1850" class="LineNr">1850 </span> <span class="Conceal">¦</span> cursor-row:num <span class="Special"><-</span> get *editor, <span class="Constant">cursor-row:offset</span> <span id="L1851" class="LineNr">1851 </span> <span class="Conceal">¦</span> cursor-column:num <span class="Special"><-</span> get *editor, <span class="Constant">cursor-column:offset</span> -<span id="L1852" class="LineNr">1852 </span> <span class="Conceal">¦</span> before-cursor:&:duplex-list:char <span class="Special"><-</span> get *editor, <span class="Constant">before-cursor:offset</span> -<span id="L1853" class="LineNr">1853 </span> <span class="Conceal">¦</span> undo:&:list:&:<a href='012-editor-undo.mu.html#L5'>operation</a> <span class="Special"><-</span> get *editor, <span class="Constant">undo:offset</span> +<span id="L1852" class="LineNr">1852 </span> <span class="Conceal">¦</span> before-cursor:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get *editor, <span class="Constant">before-cursor:offset</span> +<span id="L1853" class="LineNr">1853 </span> <span class="Conceal">¦</span> undo:&:<a href='../064list.mu.html#L6'>list</a>:&:<a href='012-editor-undo.mu.html#L5'>operation</a> <span class="Special"><-</span> get *editor, <span class="Constant">undo:offset</span> <span id="L1854" class="LineNr">1854 </span> <span class="Conceal">¦</span> <span class="Delimiter">{</span> <span id="L1855" class="LineNr">1855 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Comment"># if previous operation was an insert, coalesce this operation with it</span> <span id="L1856" class="LineNr">1856 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="muControl">break-unless</span> undo @@ -1923,9 +1923,9 @@ if ('onhashchange' in window) { <span id="L1860" class="LineNr">1860 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> previous-coalesce-tag:num <span class="Special"><-</span> get deletion, <span class="Constant">tag:offset</span> <span id="L1861" class="LineNr">1861 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> coalesce?:bool <span class="Special"><-</span> equal previous-coalesce-tag, <span class="Constant">2/coalesce-delete</span> <span id="L1862" class="LineNr">1862 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="muControl">break-unless</span> coalesce? -<span id="L1863" class="LineNr">1863 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> delete-until:&:duplex-list:char <span class="Special"><-</span> <a href='../065duplex_list.mu.html#L29'>next</a> before-cursor +<span id="L1863" class="LineNr">1863 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> delete-until:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> <a href='../065duplex_list.mu.html#L29'>next</a> before-cursor <span id="L1864" class="LineNr">1864 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> deletion <span class="Special"><-</span> put deletion, <span class="Constant">delete-until:offset</span>, delete-until -<span id="L1865" class="LineNr">1865 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> deleted-so-far:&:duplex-list:char <span class="Special"><-</span> get deletion, <span class="Constant">deleted-text:offset</span> +<span id="L1865" class="LineNr">1865 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> deleted-so-far:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get deletion, <span class="Constant">deleted-text:offset</span> <span id="L1866" class="LineNr">1866 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> deleted-so-far <span class="Special"><-</span> append deleted-so-far, deleted-cell <span id="L1867" class="LineNr">1867 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> deletion <span class="Special"><-</span> put deletion, <span class="Constant">deleted-text:offset</span>, deleted-so-far <span id="L1868" class="LineNr">1868 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> deletion <span class="Special"><-</span> put deletion, <span class="Constant">after-row:offset</span>, cursor-row @@ -1936,7 +1936,7 @@ if ('onhashchange' in window) { <span id="L1873" class="LineNr">1873 </span> <span class="Conceal">¦</span> <span class="Delimiter">}</span> <span id="L1874" class="LineNr">1874 </span> <span class="Conceal">¦</span> <span class="Comment"># if not, create a new operation</span> <span id="L1875" class="LineNr">1875 </span> <span class="Conceal">¦</span> op:&:<a href='012-editor-undo.mu.html#L5'>operation</a> <span class="Special"><-</span> new <span class="Constant"><a href='012-editor-undo.mu.html#L5'>operation</a>:type</span> -<span id="L1876" class="LineNr">1876 </span> <span class="Conceal">¦</span> deleted-until:&:duplex-list:char <span class="Special"><-</span> <a href='../065duplex_list.mu.html#L29'>next</a> before-cursor +<span id="L1876" class="LineNr">1876 </span> <span class="Conceal">¦</span> deleted-until:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> <a href='../065duplex_list.mu.html#L29'>next</a> before-cursor <span id="L1877" class="LineNr">1877 </span> <span class="Conceal">¦</span> *op <span class="Special"><-</span> merge <span class="Constant">2/delete-operation</span>, save-row/before, save-column/before, top-before, cursor-row/after, cursor-column/after, top-after, deleted-cell/deleted, before-cursor/delete-from, deleted-until, <span class="Constant">2/coalesce-delete</span> <span id="L1878" class="LineNr">1878 </span> <span class="Conceal">¦</span> editor <span class="Special"><-</span> <a href='012-editor-undo.mu.html#L200'>add-operation</a> editor, op <span id="L1879" class="LineNr">1879 </span><span class="Constant"> </span><span class="Conceal">¦</span><span class="Constant"> +done-adding-delete-operation</span> @@ -2030,15 +2030,15 @@ if ('onhashchange' in window) { <span id="L1967" class="LineNr">1967 </span>] <span id="L1968" class="LineNr">1968 </span> <span id="L1969" class="LineNr">1969 </span><span class="muRecipe">after</span> <span class="Constant"><a href='003-shortcuts.mu.html#L1789'><delete-to-end-of-line-begin></a></span> [ -<span id="L1970" class="LineNr">1970 </span> top-before:&:duplex-list:char <span class="Special"><-</span> get *editor, <span class="Constant">top-of-screen:offset</span> +<span id="L1970" class="LineNr">1970 </span> top-before:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get *editor, <span class="Constant">top-of-screen:offset</span> <span id="L1971" class="LineNr">1971 </span>] <span id="L1972" class="LineNr">1972 </span><span class="muRecipe">before</span> <span class="Constant"><a href='003-shortcuts.mu.html#L1791'><delete-to-end-of-line-end></a></span> [ <span id="L1973" class="LineNr">1973 </span> <span class="Delimiter">{</span> <span id="L1974" class="LineNr">1974 </span> <span class="Conceal">¦</span> <span class="muControl">break-unless</span> deleted-cells <span class="Comment"># delete failed; don't add an undo operation</span> -<span id="L1975" class="LineNr">1975 </span> <span class="Conceal">¦</span> top-after:&:duplex-list:char <span class="Special"><-</span> get *editor, <span class="Constant">top-of-screen:offset</span> +<span id="L1975" class="LineNr">1975 </span> <span class="Conceal">¦</span> top-after:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get *editor, <span class="Constant">top-of-screen:offset</span> <span id="L1976" class="LineNr">1976 </span> <span class="Conceal">¦</span> cursor-row:num <span class="Special"><-</span> get *editor, <span class="Constant">cursor-row:offset</span> <span id="L1977" class="LineNr">1977 </span> <span class="Conceal">¦</span> cursor-column:num <span class="Special"><-</span> get *editor, <span class="Constant">cursor-column:offset</span> -<span id="L1978" class="LineNr">1978 </span> <span class="Conceal">¦</span> deleted-until:&:duplex-list:char <span class="Special"><-</span> <a href='../065duplex_list.mu.html#L29'>next</a> before-cursor +<span id="L1978" class="LineNr">1978 </span> <span class="Conceal">¦</span> deleted-until:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> <a href='../065duplex_list.mu.html#L29'>next</a> before-cursor <span id="L1979" class="LineNr">1979 </span> <span class="Conceal">¦</span> op:&:<a href='012-editor-undo.mu.html#L5'>operation</a> <span class="Special"><-</span> new <span class="Constant"><a href='012-editor-undo.mu.html#L5'>operation</a>:type</span> <span id="L1980" class="LineNr">1980 </span> <span class="Conceal">¦</span> *op <span class="Special"><-</span> merge <span class="Constant">2/delete-operation</span>, save-row/before, save-column/before, top-before, cursor-row/after, cursor-column/after, top-after, deleted-cells/deleted, before-cursor/delete-from, deleted-until, <span class="Constant">0/never-coalesce</span> <span id="L1981" class="LineNr">1981 </span> <span class="Conceal">¦</span> editor <span class="Special"><-</span> <a href='012-editor-undo.mu.html#L200'>add-operation</a> editor, op @@ -2133,15 +2133,15 @@ if ('onhashchange' in window) { <span id="L2070" class="LineNr">2070 </span>] <span id="L2071" class="LineNr">2071 </span> <span id="L2072" class="LineNr">2072 </span><span class="muRecipe">after</span> <span class="Constant"><a href='003-shortcuts.mu.html#L1652'><delete-to-start-of-line-begin></a></span> [ -<span id="L2073" class="LineNr">2073 </span> top-before:&:duplex-list:char <span class="Special"><-</span> get *editor, <span class="Constant">top-of-screen:offset</span> +<span id="L2073" class="LineNr">2073 </span> top-before:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get *editor, <span class="Constant">top-of-screen:offset</span> <span id="L2074" class="LineNr">2074 </span>] <span id="L2075" class="LineNr">2075 </span><span class="muRecipe">before</span> <span class="Constant"><a href='003-shortcuts.mu.html#L1654'><delete-to-start-of-line-end></a></span> [ <span id="L2076" class="LineNr">2076 </span> <span class="Delimiter">{</span> <span id="L2077" class="LineNr">2077 </span> <span class="Conceal">¦</span> <span class="muControl">break-unless</span> deleted-cells <span class="Comment"># delete failed; don't add an undo operation</span> -<span id="L2078" class="LineNr">2078 </span> <span class="Conceal">¦</span> top-after:&:duplex-list:char <span class="Special"><-</span> get *editor, <span class="Constant">top-of-screen:offset</span> +<span id="L2078" class="LineNr">2078 </span> <span class="Conceal">¦</span> top-after:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get *editor, <span class="Constant">top-of-screen:offset</span> <span id="L2079" class="LineNr">2079 </span> <span class="Conceal">¦</span> op:&:<a href='012-editor-undo.mu.html#L5'>operation</a> <span class="Special"><-</span> new <span class="Constant"><a href='012-editor-undo.mu.html#L5'>operation</a>:type</span> -<span id="L2080" class="LineNr">2080 </span> <span class="Conceal">¦</span> before-cursor:&:duplex-list:char <span class="Special"><-</span> get *editor, <span class="Constant">before-cursor:offset</span> -<span id="L2081" class="LineNr">2081 </span> <span class="Conceal">¦</span> deleted-until:&:duplex-list:char <span class="Special"><-</span> <a href='../065duplex_list.mu.html#L29'>next</a> before-cursor +<span id="L2080" class="LineNr">2080 </span> <span class="Conceal">¦</span> before-cursor:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> get *editor, <span class="Constant">before-cursor:offset</span> +<span id="L2081" class="LineNr">2081 </span> <span class="Conceal">¦</span> deleted-until:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special"><-</span> <a href='../065duplex_list.mu.html#L29'>next</a> before-cursor <span id="L2082" class="LineNr">2082 </span> <span class="Conceal">¦</span> cursor-row:num <span class="Special"><-</span> get *editor, <span class="Constant">cursor-row:offset</span> <span id="L2083" class="LineNr">2083 </span> <span class="Conceal">¦</span> cursor-column:num <span class="Special"><-</span> get *editor, <span class="Constant">cursor-column:offset</span> <span id="L2084" class="LineNr">2084 </span> <span class="Conceal">¦</span> *op <span class="Special"><-</span> merge <span class="Constant">2/delete-operation</span>, save-row/before, save-column/before, top-before, cursor-row/after, cursor-column/after, top-after, deleted-cells/deleted, before-cursor/delete-from, deleted-until, <span class="Constant">0/never-coalesce</span> |