From: Jonas Fonseca Date: Fri, 17 Aug 2007 21:59:37 +0000 (+0200) Subject: status: make it possible to batch updates by pressing on the section line X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=93e4c4f6bdd04a86a105e4548acf966772be51b7;p=tig.git status: make it possible to batch updates by pressing on the section line --- diff --git a/tig.c b/tig.c index 0a42ee2..50fbaa7 100644 --- a/tig.c +++ b/tig.c @@ -3139,7 +3139,6 @@ status_update_file(struct view *view, struct status *status, enum line_type type if (written != bufsize) return FALSE; - open_view(view, REQ_VIEW_STATUS, OPEN_RELOAD); return TRUE; } @@ -3152,12 +3151,21 @@ status_update(struct view *view) assert(view->lines); if (!line->data) { - report("No file has been chosen"); - return; - } + if (line[1].type == LINE_STAT_NONE) { + report("Nothing to update"); + return; + } - if (!status_update_file(view, line->data, line->type)) + while (++line < view->line + view->lines && line->data) { + if (!status_update_file(view, line->data, line->type)) + report("Failed to update file status"); + } + + } else if (!status_update_file(view, line->data, line->type)) { report("Failed to update file status"); + } + + open_view(view, REQ_VIEW_STATUS, OPEN_RELOAD); } else { report("This action is only valid for the status view"); }