commit - 1c5e5faa6333a09f54d94e18818547ae55f433f7
commit + b65b3ea056c6456b6b335189af016235a22c2515
blob - cd781101f2b3d1c878adeb7a1acfae913bd7de0e
blob + b74a9184cdfd8150b92033cc876d77fd85cececf
--- tog/tog.c
+++ tog/tog.c
return view->parent == NULL;
}
+static int
+view_is_splitscreen(struct tog_view *view)
+{
+ return view->begin_x > 0;
+}
+
+
static const struct got_error *
view_resize(struct tog_view *view)
{
else
ncols = view->ncols + (COLS - view->cols);
- if (view->child) {
+ if (view->child && view_is_splitscreen(view->child)) {
view->child->begin_x = view_split_begin_x(view->begin_x);
if (view->child->begin_x == 0) {
ncols = COLS;
return view_resize(view);
}
-static int
-view_is_splitscreen(struct tog_view *view)
-{
- return view->begin_x > 0;
-}
-
static void
tog_resizeterm(void)
{
view->focussed = 0;
view->parent->focussed = 1;
view->parent->focus_child = 0;
+ if (!view_is_splitscreen(view))
+ err = view_fullscreen(view->parent);
}
break;
case 'q':
err = view_fullscreen(view);
} else {
err = view_splitscreen(view);
+ if (!err)
+ err = view_resize(view->parent);
}
if (err)
break;