emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 1da392d62d 2/2: Fix fontification in diff--font-lock-prettify


From: Lars Ingebrigtsen
Subject: master 1da392d62d 2/2: Fix fontification in diff--font-lock-prettify
Date: Wed, 29 Dec 2021 11:27:10 -0500 (EST)

branch: master
commit 1da392d62d1ae743151f7fda83d0725ec6053686
Author: Matthias Meulien <orontee@gmail.com>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Fix fontification in diff--font-lock-prettify
    
    * lisp/vc/diff-mode.el (diff--font-lock-prettify): Fix
    diff--font-lock-prettify on created or deleted files
    (bug#52810).
---
 lisp/vc/diff-mode.el | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index 8f83aa580e..60d210ca22 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -2612,19 +2612,17 @@ fixed, visit it in a buffer."
                          "\\(?:index.*\n\\)?"
                          "--- \\(?:" null-device "\\|a/\\(.*\\)\\)\n"
                          "\\+\\+\\+ \\(?:" null-device "\\|b/\\(.*\\)\\)\n"))))
-        (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 ""))))
+        (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))))))
   nil)
 
 ;;; Syntax highlighting from font-lock



reply via email to

[Prev in Thread] Current Thread [Next in Thread]