summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a889180)
raw | patch | inline | side by side (parent: a889180)
author | Jonas Fonseca <fonseca@diku.dk> | |
Fri, 12 May 2006 11:06:04 +0000 (13:06 +0200) | ||
committer | Jonas Fonseca <fonseca@antimatter.localdomain> | |
Fri, 12 May 2006 11:06:04 +0000 (13:06 +0200) |
tig.c | patch | blob | history |
index eb7373c96f0450c7c5f10d4ff1dc2f8d0d9bf3e5..c5f5419a7284649ca2cdd824f91740439d22e4c2 100644 (file)
--- a/tig.c
+++ b/tig.c
/**
* Git command options
* ~~~~~~~~~~~~~~~~~~~
- *
* All git command options specified on the command line will
* be passed to the given command and all will be shell quoted
* before used.
*
* NOTE: It is possible to specify options even for the main
- * view. If doing this you should not touch the --pretty
+ * view. If doing this you should not touch the `--pretty`
* option.
*
* Example on how to open the log view and show both author and
lines = view->lines - view->offset;
if (lines == 0 || view->offset + view->height >= view->lines) {
- report("Already on last line");
+ report("Cannot scroll beyond the last line");
return;
}
break;
lines = view->offset;
if (lines == 0) {
- report("Already on first line");
+ report("Cannot scroll beyond the first line");
return;
}
}
if (steps <= 0 && view->lineno == 0) {
- report("Already on first line");
+ report("Cannot move beyond the first line");
return;
} else if (steps >= 0 && view->lineno + 1 >= view->lines) {
- report("Already on last line");
+ report("Cannot move beyond the last line");
return;
}
}
}
- /* CPU hogilicious! */
- update_view_title(view);
-
if (redraw_from >= 0) {
/* If this is an incremental update, redraw the previous line
* since for commits some members could have changed when
redraw_view_from(view, redraw_from);
}
+ /* 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);
+
if (ferror(view->pipe)) {
report("Failed to read: %s", strerror(errno));
goto end;
if (split && prev->lineno - prev->offset >= prev->height) {
/* Take the title line into account. */
- int lines = prev->lineno - prev->height + 1;
+ int lines = prev->lineno - prev->offset - prev->height + 1;
/* Scroll the view that was split if the current line is
* outside the new limited view. */
return TRUE;
case REQ_SCREEN_REDRAW:
- redraw_view(view);
+ foreach_view (view, i) {
+ redraw_view(view);
+ update_view_title(view);
+ }
break;
case REQ_SCREEN_UPDATE:
/* Require titles to start with a non-space character at the
* offset used by git log. */
+ /* FIXME: More gracefull handling of titles; append "..." to
+ * shortened titles, etc. */
if (strncmp(line, " ", 4) ||
- isspace(line[5]))
+ isspace(line[4]))
break;
string_copy(commit->title, line + 4);