From: Jonas Fonseca Date: Sat, 18 Aug 2007 12:43:39 +0000 (+0200) Subject: status: cleanup status_request by resurrection status_enter X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=88f66e2de99d90d36c196d715b38b410e459f618;p=tig.git status: cleanup status_request by resurrection status_enter --- diff --git a/tig.c b/tig.c index f7e9714..83b3d18 100644 --- a/tig.c +++ b/tig.c @@ -3020,24 +3020,14 @@ status_draw(struct view *view, struct line *line, unsigned int lineno, bool sele return TRUE; } -static void status_update(struct view *view); - static enum request -status_request(struct view *view, enum request request, struct line *line) +status_enter(struct view *view, struct line *line) { struct status *status = line->data; char path[SIZEOF_STR] = ""; char *info; size_t cmdsize = 0; - if (request == REQ_STATUS_UPDATE) { - status_update(view); - return REQ_NONE; - } - - if (request != REQ_ENTER) - return request; - if (line->type == LINE_STAT_NONE || (!status && line[1].type == LINE_STAT_NONE)) { report("No file to diff"); @@ -3099,6 +3089,7 @@ status_request(struct view *view, enum request request, struct line *line) return REQ_NONE; } + static bool status_update_file(struct view *view, struct status *status, enum line_type type) { @@ -3178,6 +3169,25 @@ status_update(struct view *view) open_view(view, REQ_VIEW_STATUS, OPEN_RELOAD); } +static enum request +status_request(struct view *view, enum request request, struct line *line) +{ + switch (request) { + case REQ_STATUS_UPDATE: + status_update(view); + break; + + case REQ_ENTER: + status_enter(view, line); + break; + + default: + return request; + } + + return REQ_NONE; +} + static void status_select(struct view *view, struct line *line) {