]> git.eshelyaron.com Git - emacs.git/commitdiff
Revert "Fix fontification in diff--font-lock-prettify"
authorTassilo Horn <tsdh@gnu.org>
Wed, 29 Dec 2021 17:00:30 +0000 (18:00 +0100)
committerTassilo Horn <tsdh@gnu.org>
Wed, 29 Dec 2021 17:00:30 +0000 (18:00 +0100)
This reverts commit 1da392d62d1ae743151f7fda83d0725ec6053686.

lisp/vc/diff-mode.el

index 60d210ca2207a3ca54493d52c0bc72911f9f38cb..8f83aa580e4185d47859e41f8af59db99ef98126 100644 (file)
@@ -2612,17 +2612,19 @@ fixed, visit it in a buffer."
                          "\\(?:index.*\n\\)?"
                          "--- \\(?:" null-device "\\|a/\\(.*\\)\\)\n"
                          "\\+\\+\\+ \\(?:" null-device "\\|b/\\(.*\\)\\)\n"))))
-        (put-text-property (match-beginning 0) (1- (match-end 0))
-                           'display
-                           (propertize
-                            (cond
-                             ((null (match-string 1))
-                              (concat "new file  " (match-string 2)))
-                             ((null (match-string 2))
-                              (concat "deleted  " (match-string 1)))
-                             (t
-                              (concat "modified  " (match-string 1))))
-                            'face '(diff-file-header diff-header))))))
+        (put-text-property (match-beginning 0)
+                           (or (match-beginning 2) (match-beginning 1))
+                           'display (propertize
+                                     (cond
+                                      ((null (match-beginning 1))
+                                       (concat "new file  " (match-string 2)))
+                                      ((null (match-beginning 2))
+                                       (concat "deleted   " (match-string 1)))
+                                      (t
+                                       (concat "modified  " (match-string 1))))
+                                     'face '(diff-file-header diff-header)))
+        (put-text-property (match-end 1) (1- (match-end 0))
+                           'display ""))))
   nil)
 
 ;;; Syntax highlighting from font-lock