* Incremental updating
*/
+static void
+end_update(struct view *view)
+{
+ if (!view->pipe)
+ return;
+ set_nonblocking_input(FALSE);
+ if (view->pipe == stdin)
+ fclose(view->pipe);
+ else
+ pclose(view->pipe);
+ view->pipe = NULL;
+}
+
static bool
begin_update(struct view *view)
{
const char *id = view->id;
+ if (view->pipe)
+ end_update(view);
+
if (opt_cmd[0]) {
string_copy(view->cmd, opt_cmd);
opt_cmd[0] = 0;
return TRUE;
}
-static void
-end_update(struct view *view)
-{
- if (!view->pipe)
- return;
- set_nonblocking_input(FALSE);
- if (view->pipe == stdin)
- fclose(view->pipe);
- else
- pclose(view->pipe);
- view->pipe = NULL;
-}
-
static bool
update_view(struct view *view)
{
display[current_view] = view;
}
- resize_display();
+ if (nviews == 1 || display[1] == NULL)
+ resize_display();
if (split && prev->lineno - prev->offset >= prev->height) {
/* Take the title line into account. */
}
if (prev && view != prev) {
- /* "Blur" the previous view. */
- if (!backgrounded)
- update_view_title(prev);
-
/* Continue loading split views in the background. */
if (!split)
end_update(prev);
+ else if (!backgrounded)
+ /* "Blur" the previous view. */
+ update_view_title(prev);
+
view->parent = prev;
}
if (view == VIEW(REQ_VIEW_DIFF) &&
view->parent == VIEW(REQ_VIEW_MAIN)) {
- bool redraw = display[0] == VIEW(REQ_VIEW_MAIN);
+ bool redraw = display[1] == view;
view = view->parent;
move_view(view, request, redraw);
- update_view_title(view);
+ if (redraw)
+ update_view_title(view);
} else {
move_view(view, request, TRUE);
break;