about summary refs log tree commit diff stats
path: root/edit/001-editor.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-05-27 00:17:50 -0700
committerKartik K. Agaram <vc@akkartik.com>2017-05-27 00:17:50 -0700
commitaac76bca12c9fc60af15219d4d93d92699743ac1 (patch)
tree9f4d88c82a882ab0611f19f3259a783c642f9716 /edit/001-editor.mu
parentb7fc9d3b5c4da25af0b919e65996b5dc0c3cf9f5 (diff)
downloadmu-aac76bca12c9fc60af15219d4d93d92699743ac1.tar.gz
3880
Diffstat (limited to 'edit/001-editor.mu')
-rw-r--r--edit/001-editor.mu17
1 files changed, 1 insertions, 16 deletions
diff --git a/edit/001-editor.mu b/edit/001-editor.mu
index 50ba09f5..807cf442 100644
--- a/edit/001-editor.mu
+++ b/edit/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 [