X-Git-Url: https://git.distorted.org.uk/~mdw/tig/blobdiff_plain/dfaa6c81e5bb473fa3138f8c4f62b611c4fb7627..73c76ef5c12ef914484e1ee71e55126d74020c8d:/tig.c diff --git a/tig.c b/tig.c index 398f777..6236bf3 100644 --- a/tig.c +++ b/tig.c @@ -565,6 +565,7 @@ LINE(TREE, "tree ", COLOR_BLUE, COLOR_DEFAULT, 0), \ LINE(AUTHOR, "author ", COLOR_CYAN, COLOR_DEFAULT, 0), \ LINE(COMMITTER, "committer ", COLOR_MAGENTA, COLOR_DEFAULT, 0), \ LINE(SIGNOFF, " Signed-off-by", COLOR_YELLOW, COLOR_DEFAULT, 0), \ +LINE(ACKED, " Acked-by", COLOR_YELLOW, COLOR_DEFAULT, 0), \ LINE(DEFAULT, "", COLOR_DEFAULT, COLOR_DEFAULT, A_NORMAL), \ LINE(CURSOR, "", COLOR_WHITE, COLOR_GREEN, A_BOLD), \ LINE(STATUS, "", COLOR_GREEN, COLOR_DEFAULT, 0), \ @@ -2600,28 +2601,24 @@ tree_enter(struct view *view, struct line *line) 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); } }