]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/vc/diff-mode.el (diff-setup-buffer-type): Remove "\n" from regexp.
authorJuri Linkov <juri@linkov.net>
Mon, 25 Mar 2024 07:45:08 +0000 (09:45 +0200)
committerEshel Yaron <me@eshelyaron.com>
Wed, 27 Mar 2024 20:38:45 +0000 (21:38 +0100)
Remove extra "\n" from the end of the "diff --git.*" part
of 'diff-outline-regexp' because "\n" is not used in outline-regexp
and causes problems in such cases like when killing hunks
in the diff buffer with outline-minor-mode that loses
the outline icons because outline--fix-buttons-after-change and
outline--fix-up-all-buttons are limited to the single line and
can't match an outline line with a regexp that ends with "\n".

(cherry picked from commit f54b1d9f7b7a977ee4856c778a309c900ce9e8fa)

lisp/vc/diff-mode.el

index 0f393ba86a266bb51a4ee9649e4be099bf0e6ab3..66043059d1455b2f5c0bda79262e10f975140083 100644 (file)
@@ -1619,7 +1619,7 @@ modified lines of the diff."
                   nil)))
   (when (eq diff-buffer-type 'git)
     (setq diff-outline-regexp
-          (concat "\\(^diff --git.*\n\\|" diff-hunk-header-re "\\)")))
+          (concat "\\(^diff --git.*\\|" diff-hunk-header-re "\\)")))
   (setq-local outline-level #'diff--outline-level)
   (setq-local outline-regexp diff-outline-regexp))