summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 83c78d3)
raw | patch | inline | side by side (parent: 83c78d3)
author | Jonas Fonseca <fonseca@diku.dk> | |
Sun, 27 Apr 2008 22:21:07 +0000 (00:21 +0200) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Sun, 27 Apr 2008 22:33:20 +0000 (00:33 +0200) |
Move notification from update_view() to end_update() so <view>_read()
functions are also called when the user requests that loading views
are stopped. Allow ends to be forced so the extra spawning in the
blame view is closed as well.
functions are also called when the user requests that loading views
are stopped. Allow ends to be forced so the extra spawning in the
blame view is closed as well.
tig.c | patch | blob | history |
index 2a0d793c0bc338aed2f1bc8a6eb50d31e2da3af0..14fbf35a9f834eef1d392848a314944a37a3516c 100644 (file)
--- a/tig.c
+++ b/tig.c
*/
static void
-end_update(struct view *view)
+end_update(struct view *view, bool force)
{
if (!view->pipe)
return;
+ while (!view->ops->read(view, NULL))
+ if (!force)
+ return;
set_nonblocking_input(FALSE);
if (view->pipe == stdin)
fclose(view->pipe);
begin_update(struct view *view)
{
if (view->pipe)
- end_update(view);
+ end_update(view, TRUE);
if (opt_cmd[0]) {
string_copy(view->cmd, opt_cmd);
check_pipe:
if (ferror(view->pipe)) {
report("Failed to read: %s", strerror(errno));
- goto end;
+ end_update(view, TRUE);
} else if (feof(view->pipe)) {
report("");
- goto end;
+ end_update(view, FALSE);
}
return TRUE;
alloc_error:
report("Allocation failure");
-
-end:
- if (view->ops->read(view, NULL))
- end_update(view);
+ end_update(view, TRUE);
return FALSE;
}
view = &views[i];
if (view->pipe)
report("Stopped loading the %s view", view->name),
- end_update(view);
+ end_update(view, TRUE);
}
break;