From 60679557beb29ec77e617d2e2f90d6e58069893d Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 19 May 2017 17:40:03 -0700 Subject: 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 --- sandbox/004-programming-environment.mu | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'sandbox') diff --git a/sandbox/004-programming-environment.mu b/sandbox/004-programming-environment.mu index 656a3f97..af64076d 100644 --- a/sandbox/004-programming-environment.mu +++ b/sandbox/004-programming-environment.mu @@ -90,9 +90,9 @@ def event-loop screen:&:screen, console:&:console, env:&:environment, resources: render-all-on-no-more-events? <- copy 0/false screen <- render-all screen, env, render } - +finish-event - screen <- update-cursor screen, current-sandbox, env } + +finish-event + screen <- update-cursor screen, current-sandbox, env loop } ] @@ -241,3 +241,28 @@ def update-cursor screen:&:screen, current-sandbox:&:editor, env:&:environment - cursor-column:num <- get *current-sandbox, cursor-column:offset screen <- move-cursor screen, cursor-row, cursor-column ] + +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 + ] +] -- cgit 1.4.1-2-gfad0 ani-tty/tree/tests/unittests?id=9e7af56777839507afecf78d2a641478404fa6cf'>unittests/test_cmd_roster.h
blob: 49bd8db358f662c9ed45bcee7cd91e37361c96b7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16