summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7477b65)
raw | patch | inline | side by side (parent: 7477b65)
author | Jonas Fonseca <fonseca@diku.dk> | |
Tue, 4 May 2010 23:49:57 +0000 (19:49 -0400) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Tue, 4 May 2010 23:49:57 +0000 (19:49 -0400) |
tig.c | patch | blob | history |
index 351b933d849e1f0d502bfdc3087cd2d21abe232e..f08117e58da7979dbaa57fe83bb0c7664d1cdd3d 100644 (file)
--- a/tig.c
+++ b/tig.c
/* If non-NULL, points to the view that opened this view. If this view
* is closed tig will switch back to the parent view. */
struct view *parent;
+ struct view *prev;
/* Buffering */
size_t lines; /* Total number of lines */
if (split) {
display[1] = view;
current_view = 1;
+ view->parent = prev;
} else if (!nomaximize) {
/* Maximize the current view. */
memset(display, 0, sizeof(display));
display[current_view] = view;
}
- /* No parent signals that this is the first loaded view. */
+ /* No prev signals that this is the first loaded view. */
if (prev && view != prev) {
- view->parent = prev;
+ view->prev = prev;
}
/* Resize the view when switching between split- and full-screen,
break;
case REQ_VIEW_CLOSE:
- /* XXX: Mark closed views by letting view->parent point to the
+ /* XXX: Mark closed views by letting view->prev point to the
* view itself. Parents to closed view should never be
* followed. */
- if (view->parent &&
- view->parent->parent != view->parent) {
- maximize_view(view->parent);
- view->parent = view;
+ if (view->prev && view->prev != view) {
+ maximize_view(view->prev);
+ view->prev = view;
break;
}
/* Fall-through */
{
char path[SIZEOF_STR];
- if (!view->parent && *opt_prefix) {
+ if (!view->prev && *opt_prefix) {
string_copy(path, opt_file);
if (!string_format(opt_file, "%s%s", opt_prefix, path))
return FALSE;
const char **argv = *opt_ref ? blame_ref_argv : blame_head_argv;
struct io io = {};
- if (view->lines == 0 && !view->parent)
+ if (view->lines == 0 && !view->prev)
die("No blame exist for %s", view->vid);
if (view->lines == 0 || !io_run_rd(&io, argv, opt_cdup, FORMAT_ALL)) {
if (!line) {
int i;
- if (!view->lines && !view->parent)
+ if (!view->lines && !view->prev)
die("No revisions match the given arguments.");
if (view->lines > 0) {
commit = view->line[view->lines - 1].data;