From d55c104fbc423fede3a70f866ca16ae8988c0e86 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Sat, 11 Oct 2008 14:14:48 +0200 Subject: [PATCH] Cleanup and fix the main loop to make view point to the current view --- tig.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tig.c b/tig.c index 84e7bfc..507ecdb 100644 --- a/tig.c +++ b/tig.c @@ -6073,7 +6073,7 @@ main(int argc, const char *argv[]) if (load_refs() == ERR) die("Failed to load refs."); - for (i = 0; i < ARRAY_SIZE(views) && (view = &views[i]); i++) + foreach_view (view, i) view->cmd_env = getenv(view->cmd_env); init_display(); @@ -6084,6 +6084,7 @@ main(int argc, const char *argv[]) foreach_view (view, i) update_view(view); + view = display[current_view]; /* Refresh, accept single keystroke of input */ key = wgetch(status_win); @@ -6095,7 +6096,7 @@ main(int argc, const char *argv[]) continue; } - request = get_keybinding(display[current_view]->keymap, key); + request = get_keybinding(view->keymap, key); /* Some low-level request handling. This keeps access to * status_win restricted. */ -- 2.30.2