branch: elpa/git-commit
commit 5589aede70d4926f92cc5ce1e95854df813e64dd
Author: Jonas Bernoulli <jo...@bernoul.li>
Commit: Jonas Bernoulli <jo...@bernoul.li>

    magit-insert-section--finish: Add all properties in one go
---
 lisp/magit-section.el | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lisp/magit-section.el b/lisp/magit-section.el
index 9b67f3e944..b0c6c4ac06 100644
--- a/lisp/magit-section.el
+++ b/lisp/magit-section.el
@@ -1445,7 +1445,9 @@ anything this time around.
                    (if magit-section-inhibit-markers
                        (point)
                      (point-marker))))
-        (map (symbol-value (oref obj keymap))))
+        (props `( magit-section ,obj
+                  ,@(and-let* ((map (symbol-value (oref obj keymap))))
+                      (list 'keymap map)))))
     (unless magit-section-inhibit-markers
       (set-marker-insertion-type beg t))
     (save-excursion
@@ -1455,9 +1457,7 @@ anything this time around.
                          (point) 'magit-section)
                         end)))
           (unless (magit-section-at)
-            (put-text-property (point) next 'magit-section obj)
-            (when map
-              (put-text-property (point) next 'keymap map)))
+            (add-text-properties (point) next props))
           (magit-section-maybe-add-heading-map obj)
           (goto-char next))))
     (cond ((eq obj magit-root-section)

Reply via email to