diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2017-04-16 15:02:42 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2017-04-16 15:05:31 -0700 |
commit | ace7ffb714ce5314c665f28945ee0f3f1664f9ca (patch) | |
tree | 191088837e3a6c6fa6a38aae59431efa88c86cb9 /edit/004-programming-environment.mu | |
parent | ef73b04e744a69973208096a49d4ae52ddbb84d2 (diff) | |
download | mu-ace7ffb714ce5314c665f28945ee0f3f1664f9ca.tar.gz |
3824 - experiment: stop buffering in termbox
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)
Diffstat (limited to 'edit/004-programming-environment.mu')
-rw-r--r-- | edit/004-programming-environment.mu | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/edit/004-programming-environment.mu b/edit/004-programming-environment.mu index 943b84f3..f33bfe6f 100644 --- a/edit/004-programming-environment.mu +++ b/edit/004-programming-environment.mu @@ -96,7 +96,6 @@ def event-loop screen:&:screen, console:&:console, env:&:environment, resources: } # if it's not global and not a touch event, send to appropriate editor { - hide-screen screen sandbox-in-focus?:bool <- get *env, sandbox-in-focus?:offset { break-if sandbox-in-focus? @@ -156,7 +155,6 @@ def event-loop screen:&:screen, console:&:console, env:&:environment, resources: } +finish-event screen <- update-cursor screen, recipes, current-sandbox, sandbox-in-focus?, env - show-screen screen } loop } @@ -435,7 +433,6 @@ def render-all screen:&:screen, env:&:environment, {render-editor: (recipe (addr local-scope load-ingredients trace 10, [app], [render all] - hide-screen screen # top menu trace 11, [app], [render top menu] width:num <- screen-width screen @@ -459,8 +456,6 @@ def render-all screen:&:screen, env:&:environment, {render-editor: (recipe (addr current-sandbox:&:editor <- get *env, current-sandbox:offset sandbox-in-focus?:bool <- get *env, sandbox-in-focus?:offset screen <- update-cursor screen, recipes, current-sandbox, sandbox-in-focus?, env - # - show-screen screen ] def render-recipes screen:&:screen, env:&:environment, {render-editor: (recipe (address screen) (address editor) -> number number (address screen) (address editor))} -> screen:&:screen, env:&:environment [ @@ -514,18 +509,6 @@ def update-cursor screen:&:screen, recipes:&:editor, current-sandbox:&:editor, s screen <- move-cursor screen, cursor-row, cursor-column ] -# ctrl-l - redraw screen (just in case it printed junk somehow) - -after <global-type> [ - { - redraw-screen?:bool <- equal c, 12/ctrl-l - break-unless redraw-screen? - screen <- render-all screen, env:&:environment, render - sync-screen screen - loop +next-event - } -] - # ctrl-n - switch focus # todo: test this |