about summary refs log tree commit diff stats
path: root/sandbox/002-typing.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-05-12 07:32:46 -0700
committerKartik K. Agaram <vc@akkartik.com>2017-05-12 07:34:07 -0700
commit43f634adb0eda2fc0377423e5c5b2a7d8f087780 (patch)
tree9413077799113f237d12684aed955caf1f35c983 /sandbox/002-typing.mu
parentcd0577aeb288f57aaccd93bf88874499e3e4af1d (diff)
downloadmu-43f634adb0eda2fc0377423e5c5b2a7d8f087780.tar.gz
3852
Bugfix of commit 3850 for the sandbox/ app. I'd hoped to just quickly move
past this ugly approach, but a cleaner way is more involved than I thought.

This way is ugly partly because I'm introducing a bunch of conditionals
without testing them. One or more of my additions may well be hiding bugs.
Or I may need to add them in a few other places.

The clean way is to update the fake screen model to accurately mimic the
new real screen, where out of bounds prints aren't silently ignored, and
where scrolling is a fact of life.
Diffstat (limited to 'sandbox/002-typing.mu')
-rw-r--r--sandbox/002-typing.mu7
1 files changed, 7 insertions, 0 deletions
diff --git a/sandbox/002-typing.mu b/sandbox/002-typing.mu
index 4f704f0d..d5120f2f 100644
--- a/sandbox/002-typing.mu
+++ b/sandbox/002-typing.mu
@@ -266,10 +266,17 @@ def editor-render screen:&:screen, editor:&:editor -> screen:&:screen, editor:&:
   left:num <- get *editor, left:offset
   right:num <- get *editor, right:offset
   row:num, column:num <- render screen, editor
+  screen-height:num <- screen-height screen
+  space-left?:bool <- lesser-than row, screen-height
+  return-unless space-left?
   clear-line-until screen, right
   row <- add row, 1
+  space-left?:bool <- lesser-than row, screen-height
+  return-unless space-left?
   draw-horizontal screen, row, left, right, 9480/horizontal-dotted
   row <- add row, 1
+  space-left?:bool <- lesser-than row, screen-height
+  return-unless space-left?
   clear-screen-from screen, row, left, left, right
 ]