about summary refs log tree commit diff stats
path: root/080display.cc
Commit message (Collapse)AuthorAgeFilesLines
* 3878Kartik K. Agaram2017-05-261-0/+3
|
* 3877Kartik K. Agaram2017-05-261-2/+2
|
* 3864Kartik K. Agaram2017-05-191-2/+2
| | | | | | | | Being able to `cout` directly in raw mode isn't going to be more than a neat gimmick; we need to maintain control over colors. (The sandbox/ app was getting messed up because it just so happened that the next thing being printed to screen after the `Run` button was clear-display-from, which used `cout` with the same colors as the button.)
* 3862Kartik K. Agaram2017-05-191-8/+7
| | | | | As the finishing touch on commit 3860, completely decouple the termbox API between moving the cursor and printing at the cursor.
* 3860 - stop buffering the screen in termboxKartik K. Agaram2017-05-181-59/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* 3858Kartik K. Agaram2017-05-131-30/+0
| | | | | | | Lose the ability to hide the cursor. If we want to stop buffering the screen in termbox, it needs to go. What's more, it has no tests.
* 3857Kartik K. Agaram2017-05-131-15/+0
|
* 3854Kartik K. Agaram2017-05-131-2/+89
| | | | Revert commits 3824, 3850 and 3852. We'll redo them more carefully.
* 3849Kartik K. Agaram2017-05-101-20/+20
|
* 3842Kartik K. Agaram2017-05-041-30/+1
| | | | | | | Always start with an untouched screen that can scroll on printing "\r\n". We can still clear the screen as needed. Also drop support for hiding the cursor.
* 3824 - experiment: stop buffering in termboxKartik K. Agaram2017-04-161-59/+2
| | | | | | | | | | | | | | | | 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)
* 3597 - typo in screen checkingKartik K. Agaram2016-10-271-4/+4
| | | | Thanks Ella Couch for reporting this.
* 3561Kartik K. Agaram2016-10-221-3/+3
|
* 3522Kartik K. Agaram2016-10-191-3/+3
|
* 3306 - better error messages when mixing up screen/consoleKartik K. Agaram2016-09-081-0/+38
| | | | Thanks Ella Couch for finding this.
* 3271Kartik K. Agaram2016-08-281-1/+2
| | | | Disallow defining multiple globals at once.
* 3259Kartik K. Agaram2016-08-261-5/+5
| | | | | | | | | | | Prefer preincrement operators wherever possible. Old versions of compilers used to be better at optimizing them. Even if we don't care about performance it's useful to make unary operators look like unary operators wherever possible, and to distinguish the 'statement form' which doesn't care about the value of the expression from the postincrement which usually increments as a side-effect in some larger computation (and so is worth avoiding except for some common idioms, or perhaps even there).
* 3164Kartik K. Agaram2016-08-091-0/+1
| | | | | Have $print in console mode rotate through the screen rather than simply block at the bottom.
* 3163Kartik K. Agaram2016-08-091-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | Experimental: kinda support $print in console mode. It's not perfect and probably will never be, because 'cout' buffers differently from termbox primitives, which can cause console-aware newlines to show up before other (console-oblivious) prints, like in this example program: def main [ open-console $print [abc], 10/newline $print [def], 10/newline wait-for-some-interaction close-console ] And then there's the problem that there's no way for cout to update Display_column. So mixing $print and print will be confusing. Perhaps we should just not mess with Display_* variables inside $print? But then we'll only ever be able to see a single line of $print at a time.
* 3162Kartik K. Agaram2016-08-091-3/+5
|
* 3120Kartik K. Agaram2016-07-211-2/+2
| | | | | | | | Always show instruction before any transforms in error messages. This is likely going to make some errors unclear because they *need* to show the original instruction. But if we don't have tests for those situations did they ever really work?
* 2990Kartik K. Agaram2016-05-201-7/+7
| | | | | | | | | | Standardize quotes around reagents in error messages. I'm still sure there's issues. For example, the messages when type-checking 'copy'. I'm not putting quotes around them because in layer 60 I end up creating dilated reagents, and then it's a bit much to have quotes and (two kinds of) brackets. But I'm sure I'm doing that somewhere..
* 2803Kartik K. Agaram2016-03-211-2/+2
| | | | | Show more thorough information about instructions in the trace, but keep the original form in error messages.
* 2773 - switch to 'int'Kartik K. Agaram2016-03-131-10/+10
| | | | This should eradicate the issue of 2771.
* 2712Kartik K. Agaram2016-02-261-9/+9
|
* 2685Kartik K. Agaram2016-02-191-2/+2
| | | | | | | | | | | | | | | | Stack of plans for cleaning up replace_type_ingredients() and a couple of other things, from main problem to subproblems: include type names in the type_tree rather than in the separate properties vector make type_tree and string_tree real cons cells, with separate leaf nodes redo the vocabulary for dumping various objects: do we really need to_string and debug_string? can we have a version with *all* information? can we have to_string not call debug_string? This commit nibbles at the edges of the final task, switching from member method syntax to global function like almost everything else. I'm mostly using methods just for STL in this project.
* 2553 - keep failed specializations from generating spurious errorsKartik K. Agaram2015-12-281-1/+0
| | | | Thanks Caleb Couch.
* three bugs fixedKartik K. Agaram2015-12-151-1/+5
| | | | | | | | | | | | | | | | | - notes bug in edit/ triggers in immutable but not master branch bug triggered by changes to layer 059: we're finding an unspecialized call to 'length' in 'append_6' hard to debug because trace isn't complete just bring out the big hammer: use a new log file length_2 from recipes.mu is not being deleted (bug #1) so reload doesn't switch length to length_2 when variant_already_exists (bug #2) so we end up saving in Recipe for a primitive ordinal so no valid specialization is found for 'length' (bug #3) why doesn't it trigger in a non-interactive scenario? argh, wasn't checking for an empty line at end. ok, confidence restored.
* 2430 - make room for more transformsKartik K. Agaram2015-11-131-0/+498