commit - 4e4a9ac8bc1f43c6f8c14b163ee83d5a54f7a192
commit + 0dbbbe90fd9a3e5eec46f03459367552d13fec3c
blob - 0a55123b6b489cb5e6153aa48023d22080daa131
blob + 4a079e6345d31a3cebffc06b28e24bb8feed1604
--- tog/tog.c
+++ tog/tog.c
ncols = view->ncols - (view->cols - COLS);
else
ncols = view->ncols + (COLS - view->cols);
-
- if (wresize(view->window, nlines, ncols) == ERR)
- return got_error_from_errno("wresize");
- if (replace_panel(view->panel, view->window) == ERR)
- return got_error_from_errno("replace_panel");
- wclear(view->window);
-
- view->nlines = nlines;
- view->ncols = ncols;
- view->lines = LINES;
- view->cols = COLS;
if (view->child) {
view->child->begin_x = view_split_begin_x(view->begin_x);
if (view->child->begin_x == 0) {
+ ncols = COLS;
+
view_fullscreen(view->child);
if (view->child->focussed)
show_panel(view->child->panel);
else
show_panel(view->panel);
} else {
+ ncols = view->child->begin_x;
+
view_splitscreen(view->child);
show_panel(view->child->panel);
}
- }
+ } else if (view->parent == NULL)
+ ncols = COLS;
+ if (wresize(view->window, nlines, ncols) == ERR)
+ return got_error_from_errno("wresize");
+ if (replace_panel(view->panel, view->window) == ERR)
+ return got_error_from_errno("replace_panel");
+ wclear(view->window);
+
+ view->nlines = nlines;
+ view->ncols = ncols;
+ view->lines = LINES;
+ view->cols = COLS;
+
return NULL;
}
return err;
}
-static void
+static const struct got_error *
view_set_child(struct tog_view *view, struct tog_view *child)
{
view->child = child;
child->parent = view;
+
+ return view_resize(view);
}
static int
if (view->parent) {
view->parent->child = NULL;
view->parent->focus_child = 0;
+
+ err = view_resize(view->parent);
+ if (err)
+ break;
} else
TAILQ_REMOVE(&views, view, entry);
err = view_close_child(view);
if (err)
return err;
- view_set_child(view, diff_view);
+ err = view_set_child(view, diff_view);
+ if (err)
+ return err;
view->focus_child = 1;
} else
*new_view = diff_view;
err = view_close_child(view);
if (err)
return err;
- view_set_child(view, tree_view);
+ err = view_set_child(view, tree_view);
+ if (err)
+ return err;
view->focus_child = 1;
} else
*new_view = tree_view;
err = view_close_child(view);
if (err)
return err;
- view_set_child(view, ref_view);
+ err = view_set_child(view, ref_view);
+ if (err)
+ return err;
view->focus_child = 1;
} else
*new_view = ref_view;
err = view_close_child(view);
if (err)
break;
- view_set_child(view, diff_view);
+ err = view_set_child(view, diff_view);
+ if (err)
+ break;
view->focus_child = 1;
} else
*new_view = diff_view;
err = view_close_child(view);
if (err)
return err;
- view_set_child(view, log_view);
+ err = view_set_child(view, log_view);
+ if (err)
+ return err;
view->focus_child = 1;
} else
*new_view = log_view;
err = view_close_child(view);
if (err)
return err;
- view_set_child(view, ref_view);
+ err = view_set_child(view, ref_view);
+ if (err)
+ return err;
view->focus_child = 1;
} else
*new_view = ref_view;
err = view_close_child(view);
if (err)
return err;
- view_set_child(view, blame_view);
+ err = view_set_child(view, blame_view);
+ if (err)
+ return err;
view->focus_child = 1;
} else
*new_view = blame_view;
err = view_close_child(view);
if (err)
return err;
- view_set_child(view, log_view);
+ err = view_set_child(view, log_view);
+ if (err)
+ return err;
view->focus_child = 1;
} else
*new_view = log_view;
err = view_close_child(view);
if (err)
return err;
- view_set_child(view, tree_view);
+ err = view_set_child(view, tree_view);
+ if (err)
+ return err;
view->focus_child = 1;
} else
*new_view = tree_view;