summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 831f6e4)
raw | patch | inline | side by side (parent: 831f6e4)
author | Jonas Fonseca <fonseca@diku.dk> | |
Wed, 16 Mar 2011 01:28:46 +0000 (21:28 -0400) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Thu, 17 Mar 2011 01:19:53 +0000 (21:19 -0400) |
tig.c | patch | blob | history |
index 199eb34b7cfc434e915bf9026114dafb68ca280d..cc9b084dc1c2b1b15b10d7bbf8f5bcb22bafddc0 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -2690,6 +2690,29 @@ add_line_format(struct view *view, enum line_type type, const char *fmt, ...)
* View opening
*/
+static void
+load_view(struct view *view, enum open_flags flags)
+{
+ if (view->pipe)
+ end_update(view, TRUE);
+ if (!view->ops->open(view, flags)) {
+ report("Failed to load %s view", view->name);
+ return;
+ }
+ restore_view_position(view);
+
+ if (view->pipe && view->lines == 0) {
+ /* Clear the old view and let the incremental updating refill
+ * the screen. */
+ werase(view->win);
+ view->p_restore = flags & (OPEN_RELOAD | OPEN_REFRESH);
+ report("");
+ } else if (view_is_displayed(view)) {
+ redraw_view(view);
+ report("");
+ }
+}
+
static void
open_view(struct view *prev, enum request request, enum open_flags flags)
{
(nviews == 1 && base_view != display[0]))
resize_display();
- if (view->ops->open) {
- if (view->pipe)
- end_update(view, TRUE);
- if (!view->ops->open(view, flags)) {
- report("Failed to load %s view", view->name);
- return;
- }
- restore_view_position(view);
- }
-
if (split && prev->lineno - prev->offset >= prev->height) {
/* Take the title line into account. */
int lines = prev->lineno - prev->offset - prev->height + 1;
update_view_title(prev);
}
- if (view->pipe && view->lines == 0) {
- /* Clear the old view and let the incremental updating refill
- * the screen. */
- werase(view->win);
- view->p_restore = flags & (OPEN_RELOAD | OPEN_REFRESH);
- report("");
- } else if (view_is_displayed(view)) {
- redraw_view(view);
- report("");
- }
+ load_view(view, flags);
}
static void