]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix using log-edit-mode with git-commit-mode
authorStefan Kangas <stefankangas@gmail.com>
Fri, 7 Mar 2025 08:36:38 +0000 (09:36 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sun, 9 Mar 2025 10:23:56 +0000 (11:23 +0100)
* lisp/vc/log-edit.el (log-edit-font-lock-keywords): Avoid incorrect
fontification when used with the third-party git-commit-mode (part of
Magit).

(cherry picked from commit c6fe5b779564001e40d5779976968850aa2a166a)

lisp/vc/log-edit.el

index e23e7414a1819e9c63a9bce14695403b59ea8307..bb85de8bd1007cfdaad74f86892d3d7ef44f9dca 100644 (file)
@@ -457,9 +457,10 @@ The first subexpression is the actual text of the field.")
              'log-edit-header)
          nil lax))
      ("^\n"
-      (progn (goto-char (match-end 0)) (1+ (match-end 0))) nil
-      (0 '(face log-edit-headers-separator
-           display-line-numbers-disable t rear-nonsticky t))))
+      (and (not (bound-and-true-p git-commit-mode))
+           (progn (goto-char (match-end 0)) (1+ (match-end 0)))) nil
+      (0 '( face log-edit-headers-separator
+            display-line-numbers-disable t rear-nonsticky t))))
     (log-edit--match-first-line (0 'log-edit-summary))))
 
 (defvar log-edit-font-lock-gnu-style nil