summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5dcf806)
raw | patch | inline | side by side (parent: 5dcf806)
author | Jonas Fonseca <fonseca@diku.dk> | |
Mon, 11 Sep 2006 20:03:35 +0000 (22:03 +0200) | ||
committer | Jonas Fonseca <fonseca@antimatter.localdomain> | |
Mon, 11 Sep 2006 20:03:35 +0000 (22:03 +0200) |
This is used when clearing the old current line.
tig.c | patch | blob | history |
index fb7a9a69cb756c8638786c65b8ef97fe80cdc95d..e48af7efabc18f837097e8e5abaec8794536f430 100644 (file)
--- a/tig.c
+++ b/tig.c
struct line {
enum line_type type;
+
+ /* State flags */
+ unsigned int selected:1;
+
void *data; /* User data */
};
line = &view->line[view->offset + lineno];
- if (selected)
+ if (selected) {
+ line->selected = TRUE;
view->ops->select(view, line);
+ } else if (line->selected) {
+ line->selected = FALSE;
+ wmove(view->win, lineno, 0);
+ wclrtoeol(view->win);
+ }
return view->ops->draw(view, line, lineno, selected);
}
assert(0 <= view->lineno && view->lineno < view->lines);
/* Repaint the old "current" line if we be scrolling */
- if (ABS(steps) < view->height) {
- int prev_lineno = view->lineno - steps - view->offset;
-
- wmove(view->win, prev_lineno, 0);
- wclrtoeol(view->win);
- draw_view_line(view, prev_lineno);
- }
+ if (ABS(steps) < view->height)
+ draw_view_line(view, view->lineno - steps - view->offset);
/* Check whether the view needs to be scrolled */
if (view->lineno < view->offset ||
unsigned long old_lineno = view->lineno - view->offset;
view->lineno = lineno;
-
- wmove(view->win, old_lineno, 0);
- wclrtoeol(view->win);
draw_view_line(view, old_lineno);
draw_view_line(view, view->lineno - view->offset);