aboutsummaryrefslogtreecommitdiff
path: root/evil-search.el
diff options
context:
space:
mode:
authorVasilij Schneidermann <mail@vasilij.de>2017-07-12 21:45:56 +0200
committerEivind Fonn <evfonn@gmail.com>2019-11-25 15:55:51 +0100
commit6905af12e1e29f5a655cd5b881b138eb69db0489 (patch)
tree54fcbbba01622a2a3e1b7a49f4184e98bc966a93 /evil-search.el
parent5a7f02c3d5bf3a3feb0db5f0f8175cd5f8136388 (diff)
Change evil-goto-definition to use a hook
Diffstat (limited to 'evil-search.el')
-rw-r--r--evil-search.el13
1 files changed, 10 insertions, 3 deletions
diff --git a/evil-search.el b/evil-search.el
index c622fa5..a5e8fb1 100644
--- a/evil-search.el
+++ b/evil-search.el
@@ -286,8 +286,8 @@ otherwise for the word at point."
(evil-push-search-history string forward)
(evil-search string forward t)))))
-(defun evil-find-thing (forward thing)
- "Return THING near point as a string.
+(defun evil--find-thing (forward thing)
+ "Return a cons of THING near point as a string and its position.
THING should be a symbol understood by `thing-at-point',
e.g. 'symbol or 'word. If FORWARD is nil, search backward,
otherwise forward. Returns nil if nothing is found."
@@ -304,7 +304,14 @@ otherwise forward. Returns nil if nothing is found."
(when (stringp string)
(set-text-properties 0 (length string) nil string))
(when (> (length string) 0)
- string))))
+ (cons string (point))))))
+
+(defun evil-find-thing (forward thing)
+ "Return a THING near point as a string.
+THING should be a symbol understood by `thing-at-point',
+e.g. 'symbol or 'word. If FORWARD is nil, search backward,
+otherwise forward. Returns nil if nothing is found."
+ (car (evil--find-thing forward thing)))
(defun evil-find-word (forward)
"Return word near point as a string.