branch: externals/objed
commit d7b5768b14dcc76e8a1f8f140e9c9d77a2ecd64d
Author: Clemens Radermacher <[email protected]>
Commit: Clemens Radermacher <[email protected]>
Ignore comments for css defun object
---
objed-objects.el | 31 ++++++++++++++++---------------
1 file changed, 16 insertions(+), 15 deletions(-)
diff --git a/objed-objects.el b/objed-objects.el
index 1fc371d..a708ab7 100644
--- a/objed-objects.el
+++ b/objed-objects.el
@@ -2451,21 +2451,22 @@ non-nil the indentation block can contain empty lines."
:try-prev
(search-backward "{")
:get-obj
- (let* ((pos (point))
- (end (and (search-forward "}" nil t) (point)))
- (beg (and end
- (search-backward "{" nil t)
- (or (and (re-search-backward "^ *$" nil t)
- (1+ (match-end 0)))
- (and (re-search-backward "^" nil t)
- (line-beginning-position))))))
- (when (and beg end
- (<= beg pos end))
- (objed-make-object
- :beg beg
- :ibeg (search-forward "{")
- :end end
- :iend (1- end)))))
+ (unless (objed--in-comment-p)
+ (let* ((pos (point))
+ (end (and (search-forward "}" nil t) (point)))
+ (beg (and end
+ (search-backward "{" nil t)
+ (or (and (re-search-backward "^ *$" nil t)
+ (1+ (match-end 0)))
+ (and (re-search-backward "^" nil t)
+ (line-beginning-position))))))
+ (when (and beg end
+ (<= beg pos end))
+ (objed-make-object
+ :beg beg
+ :ibeg (search-forward "{")
+ :end end
+ :iend (1- end))))))
(objed-define-object nil tag
:atp