From aac76bca12c9fc60af15219d4d93d92699743ac1 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 27 May 2017 00:17:50 -0700 Subject: 3880 --- sandbox/001-editor.mu | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'sandbox') diff --git a/sandbox/001-editor.mu b/sandbox/001-editor.mu index 50ba09f5..807cf442 100644 --- a/sandbox/001-editor.mu +++ b/sandbox/001-editor.mu @@ -72,23 +72,8 @@ def new-editor s:text, left:num, right:num -> result:&:editor [ def insert-text editor:&:editor, text:text -> editor:&:editor [ local-scope load-ingredients - # early exit if text is empty - return-unless text - len:num <- length *text - 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 - { - done?:bool <- greater-or-equal idx, len - break-if done? - c:char <- index *text, idx - insert c, curr - # next iter - curr <- next curr - idx <- add idx, 1 - loop - } + insert curr, text ] scenario editor-initializes-without-data [ -- cgit 1.4.1-2-gfad0