branch: externals/objed
commit db8850a4ed3f5eb6255b1a80c768e003a010146b
Author: Clemens Radermacher <[email protected]>
Commit: Clemens Radermacher <[email protected]>
Improve regex object
---
objed-objects.el | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/objed-objects.el b/objed-objects.el
index 51e89c3..0eb1996 100644
--- a/objed-objects.el
+++ b/objed-objects.el
@@ -74,9 +74,12 @@
(ibounds ())
(opos (point)))
(save-mark-and-excursion
- (when (and (re-search-forward eregex nil t) ; possibly exit start
- (goto-char (or (match-beginning 1)
- (match-beginning 0)))
+ (when (and (if (looking-at bregex)
+ (re-search-forward bregex nil t)
+ (re-search-forward eregex nil t)
+ (goto-char (or (match-beginning 1)
+ (match-beginning 0)))) ; possibly exit start
+
;; goto possible start
(re-search-backward bregex nil t)
(push (or (match-end 1)