summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dec7b43)
raw | patch | inline | side by side (parent: dec7b43)
author | Jonas Fonseca <fonseca@diku.dk> | |
Sat, 18 Aug 2007 12:43:39 +0000 (14:43 +0200) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Sat, 18 Aug 2007 12:43:39 +0000 (14:43 +0200) |
tig.c | patch | blob | history |
index f7e9714c6b3328a9fc1ccbf4d15dfb44dc192fb5..83b3d18d6a962c0ec684bcebbf339f5965e074ce 100644 (file)
--- 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");
return REQ_NONE;
}
+
static bool
status_update_file(struct view *view, struct status *status, enum line_type type)
{
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)
{