summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0f72b5f)
raw | patch | inline | side by side (parent: 0f72b5f)
author | Jonas Fonseca <fonseca@diku.dk> | |
Sun, 9 May 2010 21:43:06 +0000 (17:43 -0400) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Mon, 31 May 2010 12:28:59 +0000 (08:28 -0400) |
tig.c | patch | blob | history |
index b3356ed9df80a43f62be1b82c06da976fb91afe9..f9d23ab53026e12236854ab0c168ebb783b6f91b 100644 (file)
--- a/tig.c
+++ b/tig.c
#define view_is_displayed(view) \
(view == display[0] || view == display[1])
+static enum request
+view_request(struct view *view, enum request request)
+{
+ if (!view || !view->lines)
+ return request;
+ return view->ops->request(view, request, &view->line[view->lineno]);
+}
+
/*
* View drawing.
return TRUE;
}
- if (view && view->lines) {
- request = view->ops->request(view, request, &view->line[view->lineno]);
- if (request == REQ_NONE)
- return TRUE;
- }
+ request = view_request(view, request);
+ if (request == REQ_NONE)
+ return TRUE;
switch (request) {
case REQ_MOVE_UP:
if (view_is_displayed(view))
update_view_title(view);
if (line != view->lineno)
- view->ops->request(view, REQ_ENTER,
- &view->line[view->lineno]);
-
+ view_request(view, REQ_ENTER);
} else {
move_view(view, request);
}