From 8f2046c514645767395d2ee735a99ab2358d42b9 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Thu, 10 Mar 2011 23:30:35 -0500 Subject: [PATCH] open_view: Use maximize_view to prepare non-split displays --- tig.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/tig.c b/tig.c index 0f93949..8bed28e 100644 --- a/tig.c +++ b/tig.c @@ -1977,14 +1977,16 @@ toggle_option(enum request request) } static void -maximize_view(struct view *view) +maximize_view(struct view *view, bool redraw) { memset(display, 0, sizeof(display)); current_view = 0; display[current_view] = view; resize_display(); - redraw_display(FALSE); - report(""); + if (redraw) { + redraw_display(FALSE); + report(""); + } } @@ -2755,11 +2757,7 @@ open_view(struct view *prev, enum request request, enum open_flags flags) update_view_title(prev); } } else { - /* Maximize the current view. */ - memset(display, 0, sizeof(display)); - current_view = 0; - display[current_view] = view; - resize_display(); + maximize_view(view, FALSE); } /* No prev signals that this is the first loaded view. */ @@ -3000,7 +2998,7 @@ view_driver(struct view *view, enum request request) case REQ_MAXIMIZE: if (displayed_views() == 2) - maximize_view(view); + maximize_view(view, TRUE); break; case REQ_OPTIONS: @@ -3057,7 +3055,7 @@ view_driver(struct view *view, enum request request) * view itself. Parents to closed view should never be * followed. */ if (view->prev && view->prev != view) { - maximize_view(view->prev); + maximize_view(view->prev, TRUE); view->prev = view; break; } @@ -5935,7 +5933,7 @@ main_request(struct view *view, enum request request, struct line *line) switch (request) { case REQ_ENTER: if (view_is_displayed(view) && display[0] != view) - maximize_view(view); + maximize_view(view, TRUE); open_view(view, REQ_VIEW_DIFF, flags); break; case REQ_REFRESH: -- 2.30.2