about summary refs log tree commit diff stats
path: root/100trace_browser.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-05-13 12:42:17 -0700
committerKartik K. Agaram <vc@akkartik.com>2017-05-13 12:42:17 -0700
commit0c0d1ea5cdb96a98e7eb62edbd1acb534ae12940 (patch)
tree7b64a6e98fb16d2bf02c5003acc2c14d7d1d6043 /100trace_browser.cc
parent8195ed4ee94f490d377b91caa0d79f21dd3e86ed (diff)
downloadmu-0c0d1ea5cdb96a98e7eb62edbd1acb534ae12940.tar.gz
3854
Revert commits 3824, 3850 and 3852. We'll redo them more carefully.
Diffstat (limited to '100trace_browser.cc')
-rw-r--r--100trace_browser.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/100trace_browser.cc b/100trace_browser.cc
index ffa66b41..42a4d848 100644
--- a/100trace_browser.cc
+++ b/100trace_browser.cc
@@ -276,6 +276,7 @@ bool start_search_editor(search_direction dir) {
   tb_change_cell(col, bottom_screen_line, '/', TB_WHITE, TB_BLACK);
   ++col;
   tb_set_cursor(col, bottom_screen_line);
+  tb_present();
   string pattern;
   while (true) {
     int key = read_key();
@@ -293,21 +294,25 @@ bool start_search_editor(search_direction dir) {
       if (col > /*slash*/1) {
         --col;
         tb_set_cursor(col, bottom_screen_line);
+        tb_present();
       }
     }
     else if (key == TB_KEY_ARROW_RIGHT) {
       if (col-/*slash*/1 < SIZE(pattern)) {
         ++col;
         tb_set_cursor(col, bottom_screen_line);
+        tb_present();
       }
     }
     else if (key == TB_KEY_HOME || key == TB_KEY_CTRL_A) {
       col = /*skip slash*/1;
       tb_set_cursor(col, bottom_screen_line);
+      tb_present();
     }
     else if (key == TB_KEY_END || key == TB_KEY_CTRL_E) {
       col = SIZE(pattern)+/*skip slash*/1;
       tb_set_cursor(col, bottom_screen_line);
+      tb_present();
     }
     else if (key == TB_KEY_BACKSPACE || key == TB_KEY_BACKSPACE2) {
       if (col > /*slash*/1) {
@@ -325,6 +330,7 @@ bool start_search_editor(search_direction dir) {
           tb_change_cell(SIZE(pattern)+/*skip slash*/1, bottom_screen_line, ' ', TB_WHITE, TB_BLACK);
         }
         tb_set_cursor(col, bottom_screen_line);
+        tb_present();
       }
     }
     else if (key == TB_KEY_CTRL_K) {
@@ -333,6 +339,7 @@ bool start_search_editor(search_direction dir) {
       for (int x = col;  x < old_pattern_size+/*slash*/1;  ++x)
         tb_change_cell(x, bottom_screen_line, ' ', TB_WHITE, TB_BLACK);
       tb_set_cursor(col, bottom_screen_line);
+      tb_present();
     }
     else if (key == TB_KEY_CTRL_U) {
       int old_pattern_size = SIZE(pattern);
@@ -342,6 +349,7 @@ bool start_search_editor(search_direction dir) {
       for (int x = SIZE(pattern)+/*slash*/1;  x < old_pattern_size+/*skip slash*/1;  ++x)
         tb_change_cell(x, bottom_screen_line, ' ', TB_WHITE, TB_BLACK);
       tb_set_cursor(/*start of pattern skipping slash*/1, bottom_screen_line);
+      tb_present();
     }
     else if (key < 128) {  // ascii only
       // update pattern
@@ -352,6 +360,7 @@ bool start_search_editor(search_direction dir) {
         tb_change_cell(x, bottom_screen_line, pattern.at(x-/*slash*/1), TB_WHITE, TB_BLACK);
       ++col;
       tb_set_cursor(col, bottom_screen_line);
+      tb_present();
     }
   }
 }
@@ -435,6 +444,7 @@ void render() {
     render_line(screen_row, "~", /*cursor_line?*/false);
   // move cursor back to display row at the end
   tb_set_cursor(0, Display_row);
+  tb_present();
 }
 
 int lines_hidden(int screen_row) {