summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d4d8de8)
raw | patch | inline | side by side (parent: d4d8de8)
author | Jonas Fonseca <fonseca@diku.dk> | |
Tue, 12 Sep 2006 00:05:17 +0000 (02:05 +0200) | ||
committer | Jonas Fonseca <fonseca@antimatter.localdomain> | |
Tue, 12 Sep 2006 00:16:45 +0000 (02:16 +0200) |
So now pressing 'f' on a tree link won't open a blank blob view. Also, the
blob reference shown in the title bar is always up to date.
blob reference shown in the title bar is always up to date.
tig.c | patch | blob | history |
index 66c5f7609282f16652279caa023253ba9bd741ae..6236bf310104280d4c53864d1beb5ed8ec4e305a 100644 (file)
--- a/tig.c
+++ b/tig.c
open_view(view, request, flags);
- if (!VIEW(request)->pipe)
- return TRUE;
-
- /* For tree views insert the path to the parent as the first line. */
- if (request == REQ_VIEW_BLOB) {
- /* Mirror what is showed in the title bar. */
- string_ncopy(ref_blob, data + STRING_SIZE("100644 blob "), 40);
- string_copy(VIEW(REQ_VIEW_BLOB)->ref, ref_blob);
- return TRUE;
- }
-
return TRUE;
}
static void
tree_select(struct view *view, struct line *line)
{
- if (line->type == LINE_TREE_DIR || line->type == LINE_TREE_FILE) {
- char *text = line->data;
+ char *text = line->data;
+
+ text += STRING_SIZE("100644 blob ");
+
+ if (line->type == LINE_TREE_FILE) {
+ string_ncopy(ref_blob, text, 40);
+ /* Also update the blob view's ref, since all there must always
+ * be in sync. */
+ string_copy(VIEW(REQ_VIEW_BLOB)->ref, ref_blob);
- string_ncopy(view->ref, text + STRING_SIZE("100644 blob "), 40);
- string_copy(ref_blob, view->ref);
+ } else if (line->type == LINE_TREE_DIR) {
+ string_ncopy(view->ref, text, 40);
}
}