Commit Graph

52 Commits

Author SHA1 Message Date
Kartik K. Agaram
846664c4dd . 2021-06-04 20:15:11 -07:00
Kartik K. Agaram
6f7846ebc4 .
Menu shortcut for jumping to function definition.
2021-06-04 20:13:13 -07:00
Kartik K. Agaram
f47051ae57 . 2021-06-04 20:08:29 -07:00
Kartik K. Agaram
cd4d0ae5b6 .
Keep hotkeys stable when different elements are in focus.
2021-06-04 20:07:10 -07:00
Kartik K. Agaram
b9ad848cff . 2021-06-03 14:49:49 -07:00
Kartik K. Agaram
bd49d5c35c shell: more stable trace when rerunning 2021-06-02 23:57:23 -07:00
Kartik K. Agaram
60872b2b77 . 2021-06-02 23:36:34 -07:00
Kartik K. Agaram
0ea329da1f bugfix for disappearing trace
It turns out I have a problem with trace depth somewhere which I just wasn't
noticing before. Running certain sandboxes (line; maybe loops?) twice was
causing traces to no longer start at depth 1, which implies that they weren't
terminating at depth 1. This became a lot more obvious since I instituted
a max-depth.
2021-05-31 10:14:09 -07:00
Kartik K. Agaram
067fa9c725 bugfix: unbound variables were not raising error
Since we switched error trace semantics from a designated label to a designated
depth (commit 9831a8cef9 on May 19).
2021-05-30 18:02:40 -07:00
Kartik K. Agaram
cde14438e0 first test re-running sandbox with a deeper trace 2021-05-30 16:38:20 -07:00
Kartik K. Agaram
158b53eb8f first attempt doesn't work
I was aware of some complications. The various indexes and y coordinates
in the trace's cache would be unstable and need to be recomputed. But it's
surprising that the trace _completely disappears_.
2021-05-30 09:23:36 -07:00
Kartik K. Agaram
9062eeb554 . 2021-05-29 21:45:33 -07:00
Kartik K. Agaram
10e41d00d8 . 2021-05-29 21:39:18 -07:00
Kartik K. Agaram
1eb74e2d5d shell: scrolling the trace 2021-05-29 20:52:57 -07:00
Kartik K. Agaram
9516dfa0b0 shell: skeleton for scrolling 2021-05-29 17:23:04 -07:00
Kartik K. Agaram
d85529f3fa cache visibility for all lines in trace
So far we were only doing so for the first few lines, just enough to render
one page's worth of lines. We'd have probably noticed if we collapsed some
lines after re-evaluating.
2021-05-29 17:13:06 -07:00
Kartik K. Agaram
fde296ca3c . 2021-05-29 17:03:22 -07:00
Kartik K. Agaram
58c801db0f . 2021-05-29 16:49:36 -07:00
Kartik K. Agaram
af46771821 . 2021-05-29 16:42:15 -07:00
Kartik K. Agaram
91ddc3a82d . 2021-05-29 16:41:47 -07:00
Kartik K. Agaram
c8b2424f45 shell: start implementing scrolling in the trace
I've been stymied for a week wondering how to reliably compute trace-line
identity. A trace can have multiple identical lines. Only some of them
may be visible at any point. How to remember which is which across re-evaluations?

There's no easy answer. I'm just going to keep things ad hoc. When you
re-evaluate, new lines can currently pop into visibility. However we guarantee
that just moving around the trace will be stable, thanks to the visible
bit being cached within each trace-line. Scrolling will be similar. Reevaluating
may cause the trace to be perturbed up or down. However, just scrolling
around will work reliably.
2021-05-29 16:37:32 -07:00
Kartik K. Agaram
210553ac68 .
slightly improve colors
2021-05-23 22:53:54 -07:00
Kartik K. Agaram
bda55a3eec ctrl-s in trace: show entire current line 2021-05-23 22:47:40 -07:00
Kartik K. Agaram
f32e8035c7 . 2021-05-23 22:26:49 -07:00
Kartik K. Agaram
7fa0163941 disable ctrl-s when browsing trace
We're soon going to be dynamically rerunning the sandbox in other ways
when browsing the trace.
2021-05-23 22:18:51 -07:00
Kartik K. Agaram
d474128db1 shrink trace menu 2021-05-23 22:07:50 -07:00
Kartik K. Agaram
b2dd7e6a91 start truncating trace lines 2021-05-23 22:04:31 -07:00
Kartik K. Agaram
7a04c8104d shell: reduce trace depth in sandbox
We'll gradually make this more dynamic.
2021-05-22 10:28:21 -07:00
Kartik K. Agaram
e2ab1b30b1 disallow null traces
We now use traces everywhere for error-checking. Null traces introduce
the possibility of changing a functions error response, and therefore its
semantics.
2021-05-19 20:56:37 -07:00
Kartik K. Agaram
831e2e0d64 . 2021-05-19 17:29:17 -07:00
Kartik K. Agaram
ec2dab7801 shell: traces track a maximum depth to record 2021-05-19 01:26:25 -07:00
Kartik K. Agaram
9831a8cef9 shell: depth 0 as the check for errors 2021-05-19 01:21:02 -07:00
Kartik K. Agaram
3fc03a98e5 shell: start traces at depth 1 rather than 0
We're going to carve out depth 0 for errors.
2021-05-19 01:15:35 -07:00
Kartik K. Agaram
a1cfadc749 first passing test for macroexpand
In the process I spent a long time tracking down a stray TODO in 108write.subx
that I thought would abort but didn't since the switch to baremetal.

Then after I reintroduced that assertion I had to go track down a bunch
of buffer sizes. Stream sizes continue to be a huge mess.
2021-05-06 21:38:02 -07:00
Kartik K. Agaram
83847e9f0a .
Clean up menus.
2021-05-01 16:20:44 -07:00
Kartik K. Agaram
c426cc0327 .
Clean up trace colors.
2021-05-01 15:49:48 -07:00
Kartik K. Agaram
2b616894fd move color scheme closer to Solarized dark
sed -i 's,0x12/bg=almost-black,0xdc/bg=green-bg,g' shell/*.mu
sed -i 's, 0/bg, 0xc5/bg=blue-bg,g' shell/*.mu
sed -i 's, 7/fg=trace, 0x38/fg=trace,g' shell/*.mu
sed -i 's, 7/bg=grey, 0x5c/bg=black,g' shell/*.mu

Still a few issues.

Thanks Adrian Cochrane and Zach DeCook.
  https://floss.social/@alcinnz/106152068473019933
  https://social.librem.one/@zachdecook/106159988837603417
2021-05-01 15:37:55 -07:00
Kartik K. Agaram
cbebd548ca shell: use ctrl-m rather than tab to bounce to trace
We'll save tab for inserting graphemes.
2021-04-25 21:03:05 -07:00
Kartik K. Agaram
2ff86d9162 better error message on trace overflow 2021-04-22 10:13:19 -07:00
Kartik K. Agaram
f5ece0451b start cleaning up pixel graphics
Filling pixels isn't a rare corner case. I'm going to switch to a dense
rather than sparse representation for pixels, but callers will have to
explicitly request the additional memory.
2021-04-19 10:47:30 -07:00
Kartik K. Agaram
97df52bf2f shell: ctrl-r runs on real screen without a trace
We run out of memory fairly early in the course of drawing a chessboard
on the whole screen.
2021-04-17 23:52:52 -07:00
Kartik K. Agaram
c026dba006 shell: reenable the trace
We now have a couple of protections:
  - if we get close to running out of space in the trace we drop in an
    error
  - if we run out of space in the trace we stop trying to append
  - if there are errors we cancel future evaluations

This is already much nicer. You can't do much on the Mu computer, but at
least it gracefully gives up and shows its limitations. On my computer
the Mu shell tries to run computations for about 20s before giving up.
That seems at the outer limit of what interactivity supports. If things
take too long, test smaller chunks.
2021-04-17 22:33:28 -07:00
Kartik K. Agaram
e93bbec63b shell: start jumping to keyboard using Tab 2021-04-10 22:14:20 -07:00
Kartik K. Agaram
143cce94ee support for arrow keys
Mu's keyboard handling is currently a bit of a mess, and this commit might
be a bad idea.

Ideally keyboards would return Unicode. Currently Mu returns single bytes.
Mostly ASCII. No support for international keyboards yet.

ASCII and Unicode have some keyboard scancodes grandfathered in, that don't
really make sense for data transmission. Like backspace and delete. However,
other keyboard scancodes don't have any place in Unicode. Including arrow keys.

So Mu carves out an exception to Unicode for arrow keys. We'll place the
arrow keys in a part of Unicode that is set aside for implementation-defined
behavior (https://en.wikipedia.org/wiki/C0_and_C1_control_codes#C1_controls):

  0x80: left arrow
  0x81: down arrow
  0x82: up arrow
  0x83: right arrow

The order is same as hjkl for mnemonic convenience. I'd _really_ to follow
someone else's cannibalization here. If I find one later, I'll switch to
it.

Applications that blindly assume the keyboard generates Unicode will have
a bad time. Events like backspace, delete and arrow keys are intended to
be processed early and should not be in text.

With a little luck I won't need to modify this convention when I support
international keyboards.
2021-04-05 22:37:27 -07:00
Kartik K. Agaram
e58980b4c8 get rid of ctrl-d/ctrl-u when browsing trace
Also clean up the menu. Mode-specific stuff goes after Tab.
2021-03-08 16:27:41 -08:00
Max Bernstein
96e75f1070 Add j/k keybindings for navigating trace
These are familiar for Vim users.
2021-03-08 15:40:49 -08:00
Kartik Agaram
1a1a1671ed 7866 2021-03-07 19:46:21 -08:00
Kartik K. Agaram
65e22a3628 7864 - shell: clean up the trace some more 2021-03-07 14:18:24 -08:00
Kartik K. Agaram
bcde6be528 7857 - shell: first function call 2021-03-05 15:18:46 -08:00
Kartik K. Agaram
275a652402 7853 2021-03-05 06:07:50 -08:00