diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-11-28 00:42:24 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-11-28 00:42:24 -0800 |
commit | 06ef635e8a4cbd17e43561809ed58691da6f18d7 (patch) | |
tree | b046979c511e2658276c7c81280b01374a3c4cac /sandbox | |
parent | 970df30262537492b5c60dc5c802f9bcca41a4ea (diff) | |
download | mu-06ef635e8a4cbd17e43561809ed58691da6f18d7.tar.gz |
3699
Delete some obsolete /same-as-ingredient attributes. We should always let Mu deduce those at this point.
Diffstat (limited to 'sandbox')
-rw-r--r-- | sandbox/001-editor.mu | 12 | ||||
-rw-r--r-- | sandbox/003-shortcuts.mu | 2 | ||||
-rw-r--r-- | sandbox/004-programming-environment.mu | 4 | ||||
-rw-r--r-- | sandbox/012-editor-undo.mu | 5 |
4 files changed, 10 insertions, 13 deletions
diff --git a/sandbox/001-editor.mu b/sandbox/001-editor.mu index 170468cd..c3e8e6da 100644 --- a/sandbox/001-editor.mu +++ b/sandbox/001-editor.mu @@ -73,9 +73,9 @@ def insert-text editor:&:editor, text:text -> editor:&:editor [ local-scope load-ingredients # early exit if text is empty - return-unless text, editor/same-as-ingredient:0 + return-unless text len:num <- length *text - return-unless len, editor/same-as-ingredient:0 + return-unless len idx:num <- copy 0 # now we can start appending the rest, character by character curr:&:duplex-list:char <- get *editor, data:offset @@ -89,7 +89,6 @@ def insert-text editor:&:editor, text:text -> editor:&:editor [ idx <- add idx, 1 loop } - return editor/same-as-ingredient:0 ] scenario editor-initializes-without-data [ @@ -123,7 +122,7 @@ scenario editor-initializes-without-data [ def render screen:&:screen, editor:&:editor -> last-row:num, last-column:num, screen:&:screen, editor:&:editor [ local-scope load-ingredients - return-unless editor, 1/top, 0/left, screen/same-as-ingredient:0, editor/same-as-ingredient:1 + return-unless editor, 1/top, 0/left left:num <- get *editor, left:offset screen-height:num <- screen-height screen right:num <- get *editor, right:offset @@ -218,7 +217,7 @@ def render screen:&:screen, editor:&:editor -> last-row:num, last-column:num, sc *editor <- put *editor, cursor-row:offset, cursor-row *editor <- put *editor, cursor-column:offset, cursor-column *editor <- put *editor, before-cursor:offset, before-cursor - return row, column, screen/same-as-ingredient:0, editor/same-as-ingredient:1 + return row, column ] def clear-screen-from screen:&:screen, row:num, column:num, left:num, right:num -> screen:&:screen [ @@ -228,13 +227,12 @@ def clear-screen-from screen:&:screen, row:num, column:num, left:num, right:num { break-if screen clear-display-from row, column, left, right - return screen/same-as-ingredient:0 + return } # if not, go the slower route screen <- move-cursor screen, row, column clear-line-until screen, right clear-rest-of-screen screen, row, left, right - return screen/same-as-ingredient:0 ] def clear-rest-of-screen screen:&:screen, row:num, left:num, right:num -> screen:&:screen [ diff --git a/sandbox/003-shortcuts.mu b/sandbox/003-shortcuts.mu index 248c2c64..d4255704 100644 --- a/sandbox/003-shortcuts.mu +++ b/sandbox/003-shortcuts.mu @@ -471,7 +471,7 @@ def move-cursor-coordinates-right editor:&:editor, screen-height:num -> editor:& cursor-column <- copy left *editor <- put *editor, cursor-column:offset, cursor-column below-screen?:bool <- greater-or-equal cursor-row, screen-height # must be equal - return-unless below-screen?, editor/same-as-ingredient:0, 0/no-more-render + return-unless below-screen?, editor, 0/no-more-render cursor-row <- subtract cursor-row, 1 # bring back into screen range *editor <- put *editor, cursor-row:offset, cursor-row go-render? <- copy 1/true diff --git a/sandbox/004-programming-environment.mu b/sandbox/004-programming-environment.mu index be55c7ee..c32501a6 100644 --- a/sandbox/004-programming-environment.mu +++ b/sandbox/004-programming-environment.mu @@ -157,7 +157,7 @@ def resize screen:&:screen, env:&:environment -> env:&:environment, screen:&:scr def render-without-moving-cursor screen:&:screen, editor:&:editor -> last-row:num, last-column:num, screen:&:screen, editor:&:editor [ local-scope load-ingredients - return-unless editor, 1/top, 0/left, screen/same-as-ingredient:0, editor/same-as-ingredient:1 + return-unless editor, 1/top, 0/left left:num <- get *editor, left:offset screen-height:num <- screen-height screen right:num <- get *editor, right:offset @@ -231,7 +231,7 @@ def render-without-moving-cursor screen:&:screen, editor:&:editor -> last-row:nu # save first character off-screen *editor <- put *editor, bottom-of-screen:offset, curr *editor <- put *editor, bottom:offset, row - return row, column, screen/same-as-ingredient:0, editor/same-as-ingredient:1 + return row, column ] def render-all screen:&:screen, env:&:environment, {render-editor: (recipe (address screen) (address editor) -> number number (address screen) (address editor))} -> screen:&:screen, env:&:environment [ diff --git a/sandbox/012-editor-undo.mu b/sandbox/012-editor-undo.mu index bc37f307..a3e4956d 100644 --- a/sandbox/012-editor-undo.mu +++ b/sandbox/012-editor-undo.mu @@ -74,7 +74,7 @@ after <handle-special-character> [ redo <- push op, redo *editor <- put *editor, redo:offset, redo <handle-undo> - return screen/same-as-ingredient:0, editor/same-as-ingredient:1, 1/go-render + return screen, editor, 1/go-render } ] @@ -92,7 +92,7 @@ after <handle-special-character> [ undo <- push op, undo *editor <- put *editor, undo:offset, undo <handle-redo> - return screen/same-as-ingredient:0, editor/same-as-ingredient:1, 1/go-render + return screen, editor, 1/go-render } ] @@ -206,7 +206,6 @@ def add-operation editor:&:editor, op:&:operation -> editor:&:editor [ redo:&:list:&:operation <- get *editor, redo:offset redo <- copy 0 *editor <- put *editor, redo:offset, redo - return editor/same-as-ingredient:0 ] after <handle-undo> [ |