summaryrefslogtreecommitdiff
path: root/testing/toxic/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'testing/toxic/main.c')
-rw-r--r--testing/toxic/main.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/testing/toxic/main.c b/testing/toxic/main.c
index cdc6dc16..9614d7f4 100644
--- a/testing/toxic/main.c
+++ b/testing/toxic/main.c
@@ -282,7 +282,7 @@ void prepare_window(WINDOW* w) {
282 282
283int main(int argc, char* argv[]) { 283int main(int argc, char* argv[]) {
284 int ch; 284 int ch;
285 ToxWindow* a; 285 ToxWindow* current_window;
286 286
287 init_term(); 287 init_term();
288 init_tox(); 288 init_tox();
@@ -294,22 +294,20 @@ int main(int argc, char* argv[]) {
294 do_tox(); 294 do_tox();
295 295
296 // Draw. 296 // Draw.
297 a = &windows[w_active]; 297 current_window = &windows[w_active];
298 prepare_window(a->window); 298 prepare_window(current_window->window);
299 a->blink = false; 299 current_window->blink = false;
300 a->onDraw(a); 300 current_window->onDraw(current_window);
301 draw_bar(); 301 draw_bar();
302 302
303 // Handle input. 303 // Handle input.
304 ch = getch(); 304 ch = getch();
305 if(ch == '\t') { 305 if(ch == '\t') {
306 w_active = (w_active + 1) % w_num; 306 w_active = (w_active + 1) % w_num;
307 } 307 } else if(ch == KEY_BTAB) {
308 else if(ch == KEY_BTAB) {
309 w_active = (w_active + w_num - 1) % w_num; 308 w_active = (w_active + w_num - 1) % w_num;
310 } 309 } else if(ch != ERR) {
311 else if(ch != ERR) { 310 current_window->onKey(current_window, ch);
312 a->onKey(a, ch);
313 } 311 }
314 312
315 } 313 }