about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-06-15 19:58:46 -0700
committerKartik K. Agaram <vc@akkartik.com>2017-06-15 19:58:46 -0700
commit83274dbb5f4225c5894d9ea10af6ecfee51175e0 (patch)
tree158ec56099e222552acd3469565551898aa0e499
parent606dececcbd6d8c14715c3ccfd027334c72ffae2 (diff)
downloadmu-83274dbb5f4225c5894d9ea10af6ecfee51175e0.tar.gz
3911
-rw-r--r--edit/003-shortcuts.mu22
1 files changed, 3 insertions, 19 deletions
diff --git a/edit/003-shortcuts.mu b/edit/003-shortcuts.mu
index 1fbb620f..c85d34c9 100644
--- a/edit/003-shortcuts.mu
+++ b/edit/003-shortcuts.mu
@@ -1934,32 +1934,16 @@ def minimal-render-for-ctrl-k screen:&:screen, editor:&:editor, deleted-cells:&:
   load-ingredients
   # if we deleted nothing, there's nothing to render
   return-unless deleted-cells, 0/dont-render
-  # if we have a wrapped line, give up and render the whole screen
+  # if the line used to wrap before, give up and render the whole screen
   curr-column:num <- get *editor, cursor-column:offset
-  num-deleted-cells:num <- length, deleted-cells
+  num-deleted-cells:num <- length deleted-cells
   old-row-len:num <- add curr-column, num-deleted-cells
   left:num <- get *editor, left:offset
   right:num <- get *editor, right:offset
   end:num <- subtract right, left
   wrap?:bool <- greater-or-equal old-row-len, end
   return-if wrap?, 1/go-render
-  # accumulate the current line as text and render it
-  buf:&:buffer:char <- new-buffer 30  # accumulator for the text we need to render
-  curr:&:duplex-list:char <- get *editor, before-cursor:offset
-  {
-    # check if we are at the end of the line
-    curr <- next curr
-    break-unless curr
-    c:char <- get *curr, value:offset
-    # check if we have a newline
-    b:bool <- equal c, 10
-    break-if b
-    buf <- append buf, c
-    loop
-  }
-  curr-line:text <- buffer-to-array buf
-  curr-row:num <- get *editor, cursor-row:offset
-  render-code screen, curr-line, curr-column, right, curr-row
+  clear-line-until screen, right
   return 0/dont-render
 ]