branch: externals/objed
commit 0676656dcce926c2f36a5f5a9237319aa58b9ceb
Author: Clemens Radermacher <[email protected]>
Commit: Clemens Radermacher <[email protected]>
Improve url object
---
objed-objects.el | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/objed-objects.el b/objed-objects.el
index 7b90de7..c59c7af 100644
--- a/objed-objects.el
+++ b/objed-objects.el
@@ -1641,7 +1641,17 @@ comments."
(objed-define-object nil url
:get-obj
- (bounds-of-thing-at-point 'url)
+ (let ((bounds (bounds-of-thing-at-point 'url)))
+ (when bounds
+ (objed-make-object :obounds bounds
+ :ibounds
+ (progn
+ (goto-char (car bounds))
+ (re-search-forward "https?://" nil t)
+ (cons (point)
+ (if (search-forward "/" (cdr bounds) t)
+ (1- (point))
+ (cdr bounds)))))))
:try-next
(re-search-forward "http")
:try-prev