]> git.eshelyaron.com Git - emacs.git/commitdiff
Occur-mode multi-line match property gap filling
authorMattias Engdegård <mattiase@acm.org>
Sat, 31 Jul 2021 20:37:03 +0000 (22:37 +0200)
committerMattias Engdegård <mattiase@acm.org>
Sat, 31 Jul 2021 20:46:24 +0000 (22:46 +0200)
When an occur-mode regexp matches across multiple lines, the spacing
prefixes inserted between each did not have the `occur-target`
property which is essential for jumping to the corresponding place in
the target buffer.  This prevented next-error and previous-error
from working.

* lisp/replace.el (occur-engine): Put the `occur-target` property on
the continuation prefix to avoid the gap.

lisp/replace.el

index d0c63669159a7b6349d408bdc93b6db5db509c07..148b7ce48b1a62085e703453a13deb80cf29b92b 100644 (file)
@@ -2089,8 +2089,10 @@ See also `multi-occur'."
                                "\n"
                                (if prefix-face
                                    (propertize
-                                    "\n       :" 'font-lock-face prefix-face)
-                                 "\n       :")
+                                    "\n       :" 'font-lock-face prefix-face
+                                     'occur-target markers)
+                                  (propertize
+                                  "\n       :" 'occur-target markers))
                                 ;; Add mouse face in one section to
                                 ;; ensure the prefix and the string
                                 ;; get a contiguous highlight.