summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0288f58)
raw | patch | inline | side by side (parent: 0288f58)
author | Jonas Fonseca <fonseca@diku.dk> | |
Sat, 7 Feb 2009 13:57:58 +0000 (14:57 +0100) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Sat, 7 Feb 2009 20:27:05 +0000 (21:27 +0100) |
This was developed in parallel and is very similar to patch posted by
Jeff King, however, with different goals in mind.
Message-Id: <20090207112613.GA18079@coredump.intra.peff.net>
Jeff King, however, with different goals in mind.
Message-Id: <20090207112613.GA18079@coredump.intra.peff.net>
NEWS | patch | blob | history | |
tig.c | patch | blob | history |
index 0e829203bad868c0eee0837e35bbd88a50d61e80..e2009df130e1c3149023902f529a4697cbda7fb5 100644 (file)
--- a/NEWS
+++ b/NEWS
- Colors for 256-capable terminals can be specified as colorN.
- Entering a number in the prompt will jump to that line number.
+Bug fixes:
+
+ - Blame view: use line number information when loading blame for
+ specific commit.
+
tig-0.14
--------
index 0aaf2f555417f1a67cd77ffd6114821e479fe259..fb6231f256fbbfbcbb1545dc7caaa6d0a69dd3c1 100644 (file)
--- a/tig.c
+++ b/tig.c
struct blame {
struct blame_commit *commit;
+ unsigned long lineno;
char text[1];
};
{
struct blame_commit *commit;
struct blame *blame;
- const char *pos = text + SIZEOF_REV - 1;
+ const char *pos = text + SIZEOF_REV - 2;
+ size_t orig_lineno = 0;
size_t lineno;
size_t group;
- if (strlen(text) <= SIZEOF_REV || *pos != ' ')
+ if (strlen(text) <= SIZEOF_REV || pos[1] != ' ')
return NULL;
- if (!parse_number(&pos, &lineno, 1, view->lines) ||
+ if (!parse_number(&pos, &orig_lineno, 1, 9999999) ||
+ !parse_number(&pos, &lineno, 1, view->lines) ||
!parse_number(&pos, &group, 1, view->lines - lineno + 1))
return NULL;
blame = line->data;
blame->commit = commit;
+ blame->lineno = orig_lineno + group - 1;
line->dirty = 1;
}
case REQ_VIEW_BLAME:
if (check_blame_commit(blame)) {
string_copy(opt_ref, blame->commit->id);
+ string_copy(opt_file, blame->commit->filename);
+ if (blame->lineno)
+ view->lineno = blame->lineno;
open_view(view, REQ_VIEW_BLAME, OPEN_REFRESH);
}
break;