summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b5c0483)
raw | patch | inline | side by side (parent: b5c0483)
author | Jonas Fonseca <fonseca@diku.dk> | |
Thu, 22 Jan 2009 15:59:00 +0000 (16:59 +0100) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Thu, 22 Jan 2009 15:59:00 +0000 (16:59 +0100) |
tig.c | patch | blob | history |
index 24794c6c32bb06d58abcbc750c89e1878127ec71..0e1028a7d709ffda3200e85b63c2d583785ebb5e 100644 (file)
--- a/tig.c
+++ b/tig.c
static void
select_view_line(struct view *view, unsigned long lineno)
{
- assert(view_is_displayed(view));
-
if (lineno - view->offset >= view->height) {
view->offset = lineno;
view->lineno = lineno;
- redraw_view(view);
+ if (view_is_displayed(view))
+ redraw_view(view);
} else {
unsigned long old_lineno = view->lineno - view->offset;
view->lineno = lineno;
- draw_view_line(view, old_lineno);
-
- draw_view_line(view, view->lineno - view->offset);
- redrawwin(view->win);
- wrefresh(view->win);
+ if (view_is_displayed(view)) {
+ draw_view_line(view, old_lineno);
+ draw_view_line(view, view->lineno - view->offset);
+ redrawwin(view->win);
+ wrefresh(view->win);
+ } else {
+ view->ops->select(view, &view->line[view->lineno]);
+ }
}
}