summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3a69e0d)
raw | patch | inline | side by side (parent: 3a69e0d)
author | Jonas Fonseca <fonseca@diku.dk> | |
Fri, 30 Jan 2009 08:12:26 +0000 (09:12 +0100) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Fri, 30 Jan 2009 08:18:01 +0000 (09:18 +0100) |
tig.c | patch | blob | history |
index c103062ff3d09c381ff1de7ec427c699e43c1a78..146bd7021d1dd78d457c197221e648856fadf194 100644 (file)
--- a/tig.c
+++ b/tig.c
}
+static void
+update_display_cursor(struct view *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);
+ }
+}
+
static void
update_view_title(struct view *view)
{
redraw_view(view);
update_view_title(view);
}
-}
-static void
-update_display_cursor(struct view *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);
- }
+ if (display[current_view])
+ update_display_cursor(display[current_view]);
}
static void
/* Update the title _after_ the redraw so that if the redraw picks up a
* commit reference in view->ref it'll be available here. */
update_view_title(view);
+ update_display_cursor(view);
return TRUE;
}
getmaxyx(stdscr, height, width);
- /* Resize the status view and let the view driver take
- * care of resizing the displayed views. */
- resize_display();
- redraw_display(TRUE);
+ /* Resize the status view first so the cursor is
+ * placed properly. */
wresize(status_win, 1, width);
mvwin(status_win, height - 1, 0);
wrefresh(status_win);
+ resize_display();
+ redraw_display(TRUE);
} else {
input_mode = FALSE;