about summary refs log tree commit diff stats
path: root/edit/004-programming-environment.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-05-19 17:40:03 -0700
committerKartik K. Agaram <vc@akkartik.com>2017-05-19 17:40:03 -0700
commit60679557beb29ec77e617d2e2f90d6e58069893d (patch)
treefd686aca6ab78d25e72ceda7720f7c0c3acada41 /edit/004-programming-environment.mu
parentbb2e5e65a42eadba69b3b663c4c118f64d0c4eb7 (diff)
downloadmu-60679557beb29ec77e617d2e2f90d6e58069893d.tar.gz
3866
Yet another bugfix, this time in just the sandbox/ app:
  open sandbox/ with empty lesson/ directory
  type 'a'
  press backspace
  cursor was not moving left

Now fixed.

Turns out the sandbox/ app hadn't been working right since commit 3854.
(Which ironically was a revert but clearly didn't revert enough; the last
truly good commit was 3823, and we're still clawing our way back to the
sunlight.)

The issue in this case was that commit 3853 disabled update-cursor in some
situations when it shouldn't have. To be safe, just always update-cursor
one very event. I should probably reorganize this in edit/ as well, but
it's not necessary for this particular bug.

---

Incidentally, as part of my git bisecting I realized that the bug fixed
in the trace browser as part of commit 3862 was very old:
  press '/'
  press some key
  press ctrl-u to erase
  press some key
  = out of bounds string access
Diffstat (limited to 'edit/004-programming-environment.mu')
-rw-r--r--edit/004-programming-environment.mu25
1 files changed, 25 insertions, 0 deletions
diff --git a/edit/004-programming-environment.mu b/edit/004-programming-environment.mu
index 7255c7c5..afb176a7 100644
--- a/edit/004-programming-environment.mu
+++ b/edit/004-programming-environment.mu
@@ -513,3 +513,28 @@ def draw-vertical screen:&:screen, col:num, y:num, bottom:num -> screen:&:screen
     loop
   }
 ]
+
+scenario backspace-over-text [
+  local-scope
+  trace-until 100/app  # trace too long
+  assume-screen 50/width, 15/height
+  # recipes.mu is empty
+  assume-resources [
+  ]
+  # sandbox editor contains an instruction without storing outputs
+  env:&:environment <- new-programming-environment resources, screen, []
+  # run the code in the editors
+  assume-console [
+    type [a]
+    press backspace
+  ]
+  run [
+    event-loop screen, console, env, resources
+    10:num/raw <- get *screen, cursor-row:offset
+    11:num/raw <- get *screen, cursor-column:offset
+  ]
+  memory-should-contain [
+    10 <- 1
+    11 <- 0
+  ]
+]