[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master b299c04201: Fix computation of outline heading level for non-git
From: |
Juri Linkov |
Subject: |
master b299c04201: Fix computation of outline heading level for non-git diff |
Date: |
Wed, 16 Feb 2022 14:20:36 -0500 (EST) |
branch: master
commit b299c042012c769280ede736907777e80b624ff0
Author: Matthias Meulien <orontee@gmail.com>
Commit: Juri Linkov <juri@linkov.net>
Fix computation of outline heading level for non-git diff
* lisp/vc/diff-mode.el (diff-setup-buffer-type): Compute outline heading
level
using diff-hunk-header-re (bug#51809).
(diff--font-lock-prettify): Disable prettify in non-git diff.
---
lisp/vc/diff-mode.el | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index 0bf7899246..d0c05d3204 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -1596,8 +1596,8 @@ modified lines of the diff."
nil)))
(when (eq diff-buffer-type 'git)
(setq diff-outline-regexp
- (concat "\\(^diff --git.*\n\\|" diff-hunk-header-re "\\)"))
- (setq-local outline-level #'diff--outline-level))
+ (concat "\\(^diff --git.*\n\\|" diff-hunk-header-re "\\)")))
+ (setq-local outline-level #'diff--outline-level)
(setq-local outline-regexp diff-outline-regexp))
(defun diff-delete-if-empty ()
@@ -2599,7 +2599,8 @@ fixed, visit it in a buffer."
nil nil 'center)
(defun diff--font-lock-prettify (limit)
- (when diff-font-lock-prettify
+ (when (and diff-font-lock-prettify
+ (eq diff-buffer-type 'git))
(save-excursion
;; FIXME: Include the first space for context-style hunks!
(while (re-search-forward "^[-+! ]" limit t)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master b299c04201: Fix computation of outline heading level for non-git diff,
Juri Linkov <=