From 87e196ed10888edc547e710a73a1416cb1640bd8 Mon Sep 17 00:00:00 2001 From: Phil Jackson Date: Mon, 2 Nov 2009 21:02:18 +0000 Subject: [PATCH] Highlight the sha1 at the top of a diff buffer. --- magit.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/magit.el b/magit.el index 411f8e9f..db1fb4df 100644 --- a/magit.el +++ b/magit.el @@ -2285,9 +2285,12 @@ insert a line to tell how to insert more of them" (defvar magit-currently-shown-commit nil) (defun magit-wash-commit () - (cond ((search-forward-regexp "^diff" nil t) - (goto-char (match-beginning 0)) - (magit-wash-diffs)))) + (when (looking-at "^commit \\([0-9a-fA-F]\\{40\\}\\)") + (add-text-properties (match-beginning 1) (match-end 1) + '(face magit-log-sha1))) + (search-forward-regexp "^diff" nil t) + (goto-char (match-beginning 0)) + (magit-wash-diffs)) (defun magit-refresh-commit-buffer (commit) (magit-create-buffer-sections