chiark
/
gitweb
/
~mdw
/
tig
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9b995f0
)
Factor out cursor moving
author
Jonas Fonseca
<fonseca@diku.dk>
Fri, 26 May 2006 20:08:06 +0000
(22:08 +0200)
committer
Jonas Fonseca
<fonseca@antimatter.localdomain>
Fri, 26 May 2006 20:08:06 +0000
(22:08 +0200)
tig.c
patch
|
blob
|
blame
|
history
diff --git
a/tig.c
b/tig.c
index 36669b165d7c81c3b1db309d0edc80b0520522b2..f7446576c46e41a672157aac77ff239314f40601 100644
(file)
--- a/
tig.c
+++ b/
tig.c
@@
-924,6
+924,20
@@
redraw_display(void)
}
}
}
}
+static void
+update_display_cursor(void)
+{
+ struct view *view = display[current_view];
+
+ /* Move the cursor to the right-most column of the cursor line.
+ *
+ * XXX: This could turn out to be a bit expensive, but it ensures that
+ * the cursor does not jump around. */
+ if (view->lines) {
+ wmove(view->win, view->lineno - view->offset, view->width - 1);
+ wrefresh(view->win);
+ }
+}
/*
* Navigation
/*
* Navigation
@@
-2204,15
+2218,7
@@
report(const char *msg, ...)
}
update_view_title(view);
}
update_view_title(view);
-
- /* Move the cursor to the right-most column of the cursor line.
- *
- * XXX: This could turn out to be a bit expensive, but it ensures that
- * the cursor does not jump around. */
- if (view->lines) {
- wmove(view->win, view->lineno - view->offset, view->width - 1);
- wrefresh(view->win);
- }
+ update_display_cursor();
}
/* Controls when nodelay should be in effect when polling user input. */
}
/* Controls when nodelay should be in effect when polling user input. */