diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2017-12-03 23:25:40 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2017-12-03 23:25:40 -0800 |
commit | 4a48bedcd1d708a43d43dc6259a4e45c52ea3d00 (patch) | |
tree | 85c1b7310cca932797d727a3de8da96eb175d8da /html/edit/002-typing.mu.html | |
parent | ef7d834fdd826977cd8d43253052a7b8e1c5aa72 (diff) | |
download | mu-4a48bedcd1d708a43d43dc6259a4e45c52ea3d00.tar.gz |
4134 - 'input' = 'ingredient'
Diffstat (limited to 'html/edit/002-typing.mu.html')
-rw-r--r-- | html/edit/002-typing.mu.html | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/html/edit/002-typing.mu.html b/html/edit/002-typing.mu.html index eb828377..459e32c0 100644 --- a/html/edit/002-typing.mu.html +++ b/html/edit/002-typing.mu.html @@ -67,7 +67,7 @@ if ('onhashchange' in window) { <span id="L4" class="LineNr"> 4 </span><span class="Comment"># hit ctrl-c to exit</span> <span id="L5" class="LineNr"> 5 </span><span class="muRecipe">def!</span> main text:text [ <span id="L6" class="LineNr"> 6 </span> <span class="Constant">local-scope</span> -<span id="L7" class="LineNr"> 7 </span> <span class="Constant">load-ingredients</span> +<span id="L7" class="LineNr"> 7 </span> <span class="Constant">load-inputs</span> <span id="L8" class="LineNr"> 8 </span> open-console <span id="L9" class="LineNr"> 9 </span> <a href='../081print.mu.html#L46'>clear-screen</a> <span class="Constant">0/screen</span> <span class="Comment"># non-scrolling app</span> <span id="L10" class="LineNr"> 10 </span> editor:&:editor <span class="Special"><-</span> <a href='001-editor.mu.html#L51'>new-editor</a> text, <span class="Constant">5/left</span>, <span class="Constant">45/right</span> @@ -78,7 +78,7 @@ if ('onhashchange' in window) { <span id="L15" class="LineNr"> 15 </span> <span id="L16" class="LineNr"> 16 </span><span class="muRecipe">def</span> <a href='002-typing.mu.html#L16'>editor-event-loop</a> <a href='../081print.mu.html#L16'>screen</a>:&:<a href='../081print.mu.html#L16'>screen</a>, <a href='../084console.mu.html#L23'>console</a>:&:<a href='../084console.mu.html#L23'>console</a>, editor:&:editor<span class="muRecipe"> -> </span><a href='../081print.mu.html#L16'>screen</a>:&:<a href='../081print.mu.html#L16'>screen</a>, <a href='../084console.mu.html#L23'>console</a>:&:<a href='../084console.mu.html#L23'>console</a>, editor:&:editor [ <span id="L17" class="LineNr"> 17 </span> <span class="Constant">local-scope</span> -<span id="L18" class="LineNr"> 18 </span> <span class="Constant">load-ingredients</span> +<span id="L18" class="LineNr"> 18 </span> <span class="Constant">load-inputs</span> <span id="L19" class="LineNr"> 19 </span> <span class="Delimiter">{</span> <span id="L20" class="LineNr"> 20 </span> <span class="Conceal">¦</span> <span class="Comment"># looping over each (keyboard or touch) event as it occurs</span> <span id="L21" class="LineNr"> 21 </span><span class="Constant"> </span><span class="Conceal">¦</span><span class="Constant"> +next-event</span> @@ -112,7 +112,7 @@ if ('onhashchange' in window) { <span id="L49" class="LineNr"> 49 </span><span class="Comment"># process click, return if it was on current editor</span> <span id="L50" class="LineNr"> 50 </span><span class="muRecipe">def</span> move-cursor editor:&:editor, <a href='../081print.mu.html#L16'>screen</a>:&:<a href='../081print.mu.html#L16'>screen</a>, t:<a href='../084console.mu.html#L12'>touch-event</a><span class="muRecipe"> -> </span>in-focus?:bool, editor:&:editor [ <span id="L51" class="LineNr"> 51 </span> <span class="Constant">local-scope</span> -<span id="L52" class="LineNr"> 52 </span> <span class="Constant">load-ingredients</span> +<span id="L52" class="LineNr"> 52 </span> <span class="Constant">load-inputs</span> <span id="L53" class="LineNr"> 53 </span> <span class="muControl">return-unless</span> editor, <span class="Constant">0/false</span> <span id="L54" class="LineNr"> 54 </span> click-row:num <span class="Special"><-</span> get t, <span class="Constant">row:offset</span> <span id="L55" class="LineNr"> 55 </span> <span class="muControl">return-unless</span> click-row, <span class="Constant">0/false</span> <span class="Comment"># ignore clicks on 'menu'</span> @@ -137,7 +137,7 @@ if ('onhashchange' in window) { <span id="L74" class="LineNr"> 74 </span><span class="Comment"># past the last line it positions at end of last line.</span> <span id="L75" class="LineNr"> 75 </span><span class="muRecipe">def</span> <a href='002-typing.mu.html#L75'>snap-cursor</a> editor:&:editor, <a href='../081print.mu.html#L16'>screen</a>:&:<a href='../081print.mu.html#L16'>screen</a>, target-row:num, target-column:num<span class="muRecipe"> -> </span>editor:&:editor [ <span id="L76" class="LineNr"> 76 </span> <span class="Constant">local-scope</span> -<span id="L77" class="LineNr"> 77 </span> <span class="Constant">load-ingredients</span> +<span id="L77" class="LineNr"> 77 </span> <span class="Constant">load-inputs</span> <span id="L78" class="LineNr"> 78 </span> <span class="muControl">return-unless</span> editor <span id="L79" class="LineNr"> 79 </span> left:num <span class="Special"><-</span> get *editor, <span class="Constant">left:offset</span> <span id="L80" class="LineNr"> 80 </span> right:num <span class="Special"><-</span> get *editor, <span class="Constant">right:offset</span> @@ -228,7 +228,7 @@ if ('onhashchange' in window) { <span id="L165" class="LineNr"> 165 </span><span class="Comment"># Set 'go-render?' to true to indicate the caller must perform a non-minimal update.</span> <span id="L166" class="LineNr"> 166 </span><span class="muRecipe">def</span> <a href='002-typing.mu.html#L166'>handle-keyboard-event</a> <a href='../081print.mu.html#L16'>screen</a>:&:<a href='../081print.mu.html#L16'>screen</a>, editor:&:editor, e:<a href='../084console.mu.html#L4'>event</a><span class="muRecipe"> -> </span>go-render?:bool, <a href='../081print.mu.html#L16'>screen</a>:&:<a href='../081print.mu.html#L16'>screen</a>, editor:&:editor [ <span id="L167" class="LineNr"> 167 </span> <span class="Constant">local-scope</span> -<span id="L168" class="LineNr"> 168 </span> <span class="Constant">load-ingredients</span> +<span id="L168" class="LineNr"> 168 </span> <span class="Constant">load-inputs</span> <span id="L169" class="LineNr"> 169 </span> <span class="muControl">return-unless</span> editor, <span class="Constant">0/don't-render</span> <span id="L170" class="LineNr"> 170 </span> <a href='../081print.mu.html#L768'>screen-width</a>:num <span class="Special"><-</span> <a href='../081print.mu.html#L768'>screen-width</a> <a href='../081print.mu.html#L16'>screen</a> <span id="L171" class="LineNr"> 171 </span> <a href='../081print.mu.html#L782'>screen-height</a>:num <span class="Special"><-</span> <a href='../081print.mu.html#L782'>screen-height</a> <a href='../081print.mu.html#L16'>screen</a> @@ -265,7 +265,7 @@ if ('onhashchange' in window) { <span id="L202" class="LineNr"> 202 </span> <span id="L203" class="LineNr"> 203 </span><span class="muRecipe">def</span> <a href='002-typing.mu.html#L203'>insert-at-cursor</a> editor:&:editor, c:char, <a href='../081print.mu.html#L16'>screen</a>:&:<a href='../081print.mu.html#L16'>screen</a><span class="muRecipe"> -> </span>go-render?:bool, editor:&:editor, <a href='../081print.mu.html#L16'>screen</a>:&:<a href='../081print.mu.html#L16'>screen</a> [ <span id="L204" class="LineNr"> 204 </span> <span class="Constant">local-scope</span> -<span id="L205" class="LineNr"> 205 </span> <span class="Constant">load-ingredients</span> +<span id="L205" class="LineNr"> 205 </span> <span class="Constant">load-inputs</span> <span id="L206" class="LineNr"> 206 </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="L207" class="LineNr"> 207 </span> insert c, before-cursor <span id="L208" class="LineNr"> 208 </span> before-cursor <span class="Special"><-</span> <a href='../065duplex_list.mu.html#L25'>next</a> before-cursor @@ -327,7 +327,7 @@ if ('onhashchange' in window) { <span id="L264" class="LineNr"> 264 </span><span class="Comment"># helper for tests</span> <span id="L265" class="LineNr"> 265 </span><span class="muRecipe">def</span> <a href='002-typing.mu.html#L265'>editor-render</a> <a href='../081print.mu.html#L16'>screen</a>:&:<a href='../081print.mu.html#L16'>screen</a>, editor:&:editor<span class="muRecipe"> -> </span><a href='../081print.mu.html#L16'>screen</a>:&:<a href='../081print.mu.html#L16'>screen</a>, editor:&:editor [ <span id="L266" class="LineNr"> 266 </span> <span class="Constant">local-scope</span> -<span id="L267" class="LineNr"> 267 </span> <span class="Constant">load-ingredients</span> +<span id="L267" class="LineNr"> 267 </span> <span class="Constant">load-inputs</span> <span id="L268" class="LineNr"> 268 </span> old-top-idx:num <span class="Special"><-</span> <a href='../081print.mu.html#L509'>save-top-idx</a> <a href='../081print.mu.html#L16'>screen</a> <span id="L269" class="LineNr"> 269 </span> left:num <span class="Special"><-</span> get *editor, <span class="Constant">left:offset</span> <span id="L270" class="LineNr"> 270 </span> right:num <span class="Special"><-</span> get *editor, <span class="Constant">right:offset</span> @@ -930,7 +930,7 @@ if ('onhashchange' in window) { <span id="L867" class="LineNr"> 867 </span> <span id="L868" class="LineNr"> 868 </span><span class="muRecipe">def</span> <a href='002-typing.mu.html#L868'>insert-new-line-and-indent</a> editor:&:editor, <a href='../081print.mu.html#L16'>screen</a>:&:<a href='../081print.mu.html#L16'>screen</a><span class="muRecipe"> -> </span>editor:&:editor, <a href='../081print.mu.html#L16'>screen</a>:&:<a href='../081print.mu.html#L16'>screen</a> [ <span id="L869" class="LineNr"> 869 </span> <span class="Constant">local-scope</span> -<span id="L870" class="LineNr"> 870 </span> <span class="Constant">load-ingredients</span> +<span id="L870" class="LineNr"> 870 </span> <span class="Constant">load-inputs</span> <span id="L871" class="LineNr"> 871 </span> cursor-row:num <span class="Special"><-</span> get *editor, <span class="Constant">cursor-row:offset</span> <span id="L872" class="LineNr"> 872 </span> cursor-column:num <span class="Special"><-</span> get *editor, <span class="Constant">cursor-column:offset</span> <span id="L873" class="LineNr"> 873 </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> @@ -976,7 +976,7 @@ if ('onhashchange' in window) { <span id="L913" class="LineNr"> 913 </span> <span id="L914" class="LineNr"> 914 </span><span class="muRecipe">def</span> <a href='002-typing.mu.html#L914'>at-start-of-wrapped-line?</a> editor:&:editor<span class="muRecipe"> -> </span>result:bool [ <span id="L915" class="LineNr"> 915 </span> <span class="Constant">local-scope</span> -<span id="L916" class="LineNr"> 916 </span> <span class="Constant">load-ingredients</span> +<span id="L916" class="LineNr"> 916 </span> <span class="Constant">load-inputs</span> <span id="L917" class="LineNr"> 917 </span> left:num <span class="Special"><-</span> get *editor, <span class="Constant">left:offset</span> <span id="L918" class="LineNr"> 918 </span> cursor-column:num <span class="Special"><-</span> get *editor, <span class="Constant">cursor-column:offset</span> <span id="L919" class="LineNr"> 919 </span> cursor-at-left?:bool <span class="Special"><-</span> equal cursor-column, left @@ -996,7 +996,7 @@ if ('onhashchange' in window) { <span id="L933" class="LineNr"> 933 </span><span class="Comment"># the number of spaces at the start of the line containing 'curr'.</span> <span id="L934" class="LineNr"> 934 </span><span class="muRecipe">def</span> <a href='002-typing.mu.html#L934'>line-indent</a> curr:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char, start:&:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char<span class="muRecipe"> -> </span>result:num [ <span id="L935" class="LineNr"> 935 </span> <span class="Constant">local-scope</span> -<span id="L936" class="LineNr"> 936 </span> <span class="Constant">load-ingredients</span> +<span id="L936" class="LineNr"> 936 </span> <span class="Constant">load-inputs</span> <span id="L937" class="LineNr"> 937 </span> result:num <span class="Special"><-</span> copy<span class="Constant"> 0</span> <span id="L938" class="LineNr"> 938 </span> <span class="muControl">return-unless</span> curr <span id="L939" class="LineNr"> 939 </span> at-start?:bool <span class="Special"><-</span> equal curr, start @@ -1178,22 +1178,22 @@ if ('onhashchange' in window) { <span id="L1115" class="LineNr">1115 </span> <span id="L1116" class="LineNr">1116 </span><span class="muRecipe">def</span> <a href='002-typing.mu.html#L1116'>draw-horizontal</a> <a href='../081print.mu.html#L16'>screen</a>:&:<a href='../081print.mu.html#L16'>screen</a>, row:num, x:num, right:num<span class="muRecipe"> -> </span><a href='../081print.mu.html#L16'>screen</a>:&:<a href='../081print.mu.html#L16'>screen</a> [ <span id="L1117" class="LineNr">1117 </span> <span class="Constant">local-scope</span> -<span id="L1118" class="LineNr">1118 </span> <span class="Constant">load-ingredients</span> +<span id="L1118" class="LineNr">1118 </span> <span class="Constant">load-inputs</span> <span id="L1119" class="LineNr">1119 </span> height:num <span class="Special"><-</span> <a href='../081print.mu.html#L782'>screen-height</a> <a href='../081print.mu.html#L16'>screen</a> <span id="L1120" class="LineNr">1120 </span> past-bottom?:bool <span class="Special"><-</span> greater-or-equal row, height <span id="L1121" class="LineNr">1121 </span> <span class="muControl">return-if</span> past-bottom? -<span id="L1122" class="LineNr">1122 </span> style:char, style-found?:bool <span class="Special"><-</span> <span class="Constant">next-ingredient</span> +<span id="L1122" class="LineNr">1122 </span> style:char, style-found?:bool <span class="Special"><-</span> <span class="Constant">next-input</span> <span id="L1123" class="LineNr">1123 </span> <span class="Delimiter">{</span> <span id="L1124" class="LineNr">1124 </span> <span class="Conceal">¦</span> <span class="muControl">break-if</span> style-found? <span id="L1125" class="LineNr">1125 </span> <span class="Conceal">¦</span> style <span class="Special"><-</span> copy <span class="Constant">9472/horizontal</span> <span id="L1126" class="LineNr">1126 </span> <span class="Delimiter">}</span> -<span id="L1127" class="LineNr">1127 </span> color:num, color-found?:bool <span class="Special"><-</span> <span class="Constant">next-ingredient</span> +<span id="L1127" class="LineNr">1127 </span> color:num, color-found?:bool <span class="Special"><-</span> <span class="Constant">next-input</span> <span id="L1128" class="LineNr">1128 </span> <span class="Delimiter">{</span> <span id="L1129" class="LineNr">1129 </span> <span class="Conceal">¦</span> <span class="Comment"># default color to white</span> <span id="L1130" class="LineNr">1130 </span> <span class="Conceal">¦</span> <span class="muControl">break-if</span> color-found? <span id="L1131" class="LineNr">1131 </span> <span class="Conceal">¦</span> color <span class="Special"><-</span> copy <span class="Constant">245/grey</span> <span id="L1132" class="LineNr">1132 </span> <span class="Delimiter">}</span> -<span id="L1133" class="LineNr">1133 </span> bg-color:num, bg-color-found?:bool <span class="Special"><-</span> <span class="Constant">next-ingredient</span> +<span id="L1133" class="LineNr">1133 </span> bg-color:num, bg-color-found?:bool <span class="Special"><-</span> <span class="Constant">next-input</span> <span id="L1134" class="LineNr">1134 </span> <span class="Delimiter">{</span> <span id="L1135" class="LineNr">1135 </span> <span class="Conceal">¦</span> <span class="muControl">break-if</span> bg-color-found? <span id="L1136" class="LineNr">1136 </span> <span class="Conceal">¦</span> bg-color <span class="Special"><-</span> copy <span class="Constant">0/black</span> |