summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fab6282)
raw | patch | inline | side by side (parent: fab6282)
author | Jonas Fonseca <fonseca@diku.dk> | |
Fri, 11 Mar 2011 04:27:22 +0000 (23:27 -0500) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Thu, 17 Mar 2011 01:21:01 +0000 (21:21 -0400) |
tig.c | patch | blob | history |
index fd40b8e98027c3aeac5a9c55a130d902c98e102f..0f9394971629665bec78ae24e21fd6a3b83ffcf7 100644 (file)
--- a/tig.c
+++ b/tig.c
bool reload = !!(flags & (OPEN_RELOAD | OPEN_PREPARED));
struct view *view = VIEW(request);
int nviews = displayed_views();
- struct view *base_view = display[0];
assert(flags ^ OPEN_REFRESH);
display[1] = view;
current_view = 1;
view->parent = prev;
+ resize_display();
+
+ if (prev->lineno - prev->offset >= prev->height) {
+ /* Take the title line into account. */
+ int lines = prev->lineno - prev->offset - prev->height + 1;
+
+ /* Scroll the view that was split if the current line is
+ * outside the new limited view. */
+ do_scroll_view(prev, lines);
+ }
+
+ if (view != prev && view_is_displayed(prev)) {
+ /* "Blur" the previous view. */
+ update_view_title(prev);
+ }
} else {
/* Maximize the current view. */
memset(display, 0, sizeof(display));
current_view = 0;
display[current_view] = view;
+ resize_display();
}
/* No prev signals that this is the first loaded view. */
view->prev = prev;
}
- /* Resize the view when switching between split- and full-screen,
- * or when switching between two different full-screen views. */
- if (nviews != displayed_views() ||
- (nviews == 1 && base_view != display[0]))
- resize_display();
-
- if (split && prev->lineno - prev->offset >= prev->height) {
- /* Take the title line into account. */
- int lines = prev->lineno - prev->offset - prev->height + 1;
-
- /* Scroll the view that was split if the current line is
- * outside the new limited view. */
- do_scroll_view(prev, lines);
- }
-
- if (prev && view != prev && split && view_is_displayed(prev)) {
- /* "Blur" the previous view. */
- update_view_title(prev);
- }
-
load_view(view, flags);
}