commit - f2d06bef0f9de303eb6de9523de85da21645850f
commit + 6ec3d39ca03fd5b2f4bf0d896a3b9171644390cd
blob - 1bc0752f6f3684856059199715c5278f8db65cf5
blob + ca4b32aa5e3ae11946ad03de15bb435c4f3aceca
--- tog/tog.c
+++ tog/tog.c
err = view_input(&new_view, &done, view, &views);
if (err)
break;
+
+ if (view->dying && view == TAILQ_FIRST(&views) &&
+ TAILQ_NEXT(view, entry) == NULL)
+ done = 1;
+ if (done) {
+ struct tog_view *v;
+
+ /*
+ * When we quit, scroll the screen up a single line
+ * so we don't lose any information.
+ */
+ TAILQ_FOREACH(v, &views, entry) {
+ wmove(v->window, 0, 0);
+ wdeleteln(v->window);
+ wnoutrefresh(v->window);
+ if (v->child && !view_is_fullscreen(v)) {
+ wmove(v->child->window, 0, 0);
+ wdeleteln(v->child->window);
+ wnoutrefresh(v->child->window);
+ }
+ }
+ doupdate();
+ }
+
if (view->dying) {
struct tog_view *v, *prev = NULL;
TAILQ_INSERT_TAIL(&views, new_view, entry);
view = new_view;
}
- if (view) {
+ if (view && !done) {
if (view_is_parent_view(view)) {
if (view->child && view->child->focussed)
view = view->child;
}
endwin();
- putchar('\n');
if (cmd_argv) {
int i;
for (i = 0; i < argc; i++)