| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
They uncovered one bug: in edit/003-shortcuts.mu
<scroll-down> was returning 0 for an address in one place where I
thought it was returning 0 for a boolean.
Now we've eliminated this bad interaction between tangling and punning
literals.
|
| |
|
| |
|
|
|
|
|
|
| |
This regression was introduced by commit 3902 in June.
Making this commit clean took the last 4 commits of reorganizing.
|
|
|
|
|
| |
It's always been ugly that I referred to a later layer/feature in a
label name.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Don't unnecessarily write sandboxes to disk on F4.
This seems to save almost 20% time when processing a large lesson
directory with 36 sandboxes.
|
|
|
|
|
|
|
|
| |
Improvement on fix 3957: rather than put a band-aid over a slow
operation, eliminate the slowdown entirely.
In this case it turns out we're unnecessarily saving files to disk when
they could never be modified. Are we doing this on F4 as well?!
|
|
|
|
|
| |
Move a scenario which is after commit 3954 applicable to both editors,
not just the recipe side.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As a blanket rule, down-arrow now stops scrolling once the bottom margin
comes on screen.
Now that we have page-wise scrolling with ctrl-f/b and line-wise
scrolling with ctrl-s/x, we don't need to conflate scroll positioning
with the arrow keys. And as a result, early students no longer have to
struggle with accidentally scrolling part of the sandbox off the screen
when there's tons of empty space available.
`move-to-next-line` is still super messy and will need further
rethinking, but this commit simplifies the codebase as a whole by
eliminating a couple of historical accidents:
a) We only introduced scrolling past the bottom of the screen to allow
more sandboxes to come into view before we had scrolling for the
sandbox side.
b) We undid scrolling past the bottom in just the recipe side to allow
errors to come into view.
Since these historical details are now irrelevant, we no longer need
separate logic for the recipe and sandbox sides, and we don't need to
keep track of the recipe-bottom separate from the bottom margin of
arbitrary editors.
|
|
|
|
| |
Fix the failing scenario of commit 3944.
|
|
|
|
|
|
|
| |
Reintroduce the failing test of commit 3938. It has two problems:
a) it's failing, and
b) it's not failing the same way as with a real screen.
|
|
|
|
| |
Undo commit 3938 and almost everything after. Let's do this right.
|
|
|
|
|
|
|
|
| |
No, my conclusion in the previous commit was wrong. When you print a
character on the right margin, the cursor coordinates always wrap around
to the left margin on the next row. It's just that if you're at the
bottom of the screen, scrolling gives the impression that the row didn't
change.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Even though the bug of commit 3938 is now fixed, I'm still trying to
track down why the failure looked different on the fake screen than on
the real one. Snapshot as I try to track down the difference.
One key lesson is that the approach of commit 3860 -- updating the
cursor before rather than after printing each character -- turns out to
be untenable. A sequence of `print` followed by `cursor-position` needs
to behave the same as the real screen.
But it's still not clear how the real screen. When you get to the end of
a line the cursor position wraps after print to the left margin (column
0) on the next row. When you get to the bottom right the cursor position
wraps to the *bottom left* margin. How the heck does it know to scroll
on the next print, then? Is there some hidden state in the terminal?
|
| |
|
| |
|
|
|
|
|
|
|
| |
Fix an out-of-bounds write to the screen when sandboxes aligned just
right.
Thanks Ella Couch for reporting this issue.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This change is interesting because I only updated one test to gain confidence
that F4 will never redraw the recipe side. (Most of the changes are to
explicitly render-all before each scenario.)
|
|
|
|
| |
Thanks Juan Crispin Hernandez for the suggestion.
|
|
|
|
|
|
|
|
| |
Strange race condition: if I repeatedly press <enter> and <backspace> so
the screen is constantly playing catch up, it will sometimes fail these
assertions when it does eventually catch up. Somehow the cursor ends up
misplaced. Let's just take them out. It's likely some low-level implementation
detail of the terminal.
|
|
|
|
| |
Clean up a few superficial things in Caleb's commit.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To achieve this we have to switch to a model of the screen in termbox that
is closer to the underlying terminal.
Before:
a screen is a grid of characters
writing out of bounds does nothing
After:
a screen is a scrolling raster of characters
writing out of bounds wraps to next line and scrolls if necessary
To move to the new model, it was essential that I migrate my fake screen
at the same time to mimic it. This is why the first attempt (commit 3824)
failed (commit 3858). This is also why this commit can't be split into
smaller pieces.
The fake screen now 'scrolls' by rotating screen lines from top to bottom.
There's still no notion of a scrollback buffer.
The newer model is richer; it permits repl-like apps that upstream termbox
can't do easily. It also permits us to simply use `printf` or `cout` to
write to the screen, and everything mostly works as you would expect. Exceptions:
a) '\n' won't do what you expect. You need to explicitly print both '\n'
and '\r'.
b) backspace won't do what you expect. It only moves the cursor back,
without erasing the previous character. It does not wrap.
Both behaviors exactly mimic my existing terminal's emulation of vt100.
The catch: it's easy to accidentally scroll in apps. Out-of-bounds prints
didn't matter before, but they're bugs now. To help track them down, use
the `save-top-idx`, `assert-no-scroll` pair of helpers.
An important trick is to wrap the cursor before rather after printing
a character. Otherwise we end up scrolling every time we print to the
bottom-right character. This means that the cursor position can be invalid
at the start of a print, and we need to handle that.
In the process we also lose the ability to hide and show the screen. We
have to show the prints happening. Seems apt for a "white-box" platform
like Mu.
|
|
|
|
| |
Revert commits 3824, 3850 and 3852. We'll redo them more carefully.
|
|
|
|
|
| |
Bugfix: writes out of bounds used to be skipped, but started clobbering
the screen on commit 3824.
|
| |
|
|
|
|
| |
Fix CI.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now it's much more apparent why things are slow. You can see each repaint
happening. Already I fixed one performance bug -- in clear-rest-of-screen.
Since this subverts Mu's fake screen there may be bugs.
Another salubrious side effect: I've finally internalized that switching
to raw mode doesn't have to clear the screen. That was just an artifact
of how termbox abstracted operations. Now I can conceive of using termbox
to build a repl as well.
(I was inspired to poke into termbox internals by
http://viewsourcecode.org/snaptoken/kilo and
https://github.com/antirez/linenoise)
|
|
|
|
|
|
| |
Standardize the order of some common blocks in `render`, `render-text`
and `render-code`. This is preparation for trying to reorganize them to
reduce duplicate code.
|
|
|
|
| |
Fix a _very_ misleading comment.
|
|
|
|
|
|
| |
Move 'render-code' to the layer where it's used.
Thanks Caleb Couch for finding this bit of ugliness.
|
|
|
|
| |
Don't try to snapshot in scenarios.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I accidentally got rid of git snapshotting of lessons back when I switched
to testable file primitives last December (commit 3705).
>:-(
Bringing it back now, hopefully better. The improvement is that there's
now at most one commit every time we hit F4.
This change adds yet another reason that running `mu` from a different
directory is just not supported.
|
| |
|
|
|
|
|
|
|
| |
Stop trying to create a new layer showing how we minimize prints.
Stephen's suggestion is to create a data structure that encapsulates
instructions to `insert-at-cursor` for either just printing a character
to screen or rendering everything. Let's try that at some point.
|
| |
|
|
|
|
|
| |
We do support printing non-integer numbers for some time, albeit using
the underlying host platform.
|
| |
|
|
|
|
|
|
| |
Decouple editor initialization from rendering to screen. This hugely
simplifies the header of 'new-editor' and makes clear that it was only
using the screen for rendering.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Stop requiring jump instructions to explicitly provide a ':label' type
for jump targets.
This has been a source of repeated confusion for my students:
a) They'd add the ':label' to the label definition rather than the
jump target (label use)
b) They'd spend time thinking about whether the initial '+' prefix was
part of the label name.
In the process I cleaned up a couple of things:
- the space of names is more cleanly partitioned into labels and
non-labels (clarifying that '_' and '-' are non-label prefixes)
- you can't use label names as regular variables anymore
- you can infer the type of a label just from its name
|