Fix magit-section-beginning-position.

* magit.el (magit-section-beginning-position): Just search backwards
for the first property change, don't try to skip over children.
This commit is contained in:
Marius Vollmer 2008-08-31 02:48:05 +03:00
parent ae5b5d4fe0
commit f042b74925

View file

@ -349,14 +349,11 @@ Many Magit faces inherit from this one by default."
(not (eq (cadr s2) (cadr s1))))))
(defun magit-section-beginning-position (p)
(let ((s1 (magit-section-mark p)))
(if (not s1)
nil
(while (let ((s2 (magit-section-mark (- p 1))))
(not (magit-section-sibling-or-higher-p s1 s2)))
(setq p (previous-single-property-change p 'magit-section
nil (point-min))))
p)))
(previous-single-property-change (if (= p (point-max))
p
(+ p 1))
'magit-section
nil (point-min)))
(defun magit-section-ending-position (p)
(let ((s1 (magit-section-mark p)))