diff options
| author | Vasilij Schneidermann <mail@vasilij.de> | 2017-12-31 17:45:31 +0100 |
|---|---|---|
| committer | Vasilij Schneidermann <mail@vasilij.de> | 2018-01-03 19:07:14 +0100 |
| commit | 60c2e702e08585e979e5f6cbdb796cd5475abd34 (patch) | |
| tree | fd02ec39420b4acb757a8301e7781587aa351d56 /evil-commands.el | |
| parent | 3475b3260c290e5ea5e45d9bfc89005c06846152 (diff) | |
Use xref-find-definitions if possible
Closes #952
Diffstat (limited to 'evil-commands.el')
| -rw-r--r-- | evil-commands.el | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/evil-commands.el b/evil-commands.el index 4def324..2654f85 100644 --- a/evil-commands.el +++ b/evil-commands.el @@ -784,12 +784,17 @@ If called with a prefix argument, provide a prompt for specifying the tag." :jump t (interactive "P") - (if arg (call-interactively #'find-tag) - (let ((tag (funcall (or find-tag-default-function - (get major-mode 'find-tag-default-function) - #'find-tag-default)))) - (unless tag (user-error "No tag candidate found around point")) - (find-tag tag)))) + (cond + ((fboundp 'xref-find-definitions) + (let ((xref-prompt-for-identifier arg)) + (call-interactively #'xref-find-definitions))) + ((fboundp 'find-tag) + (if arg (call-interactively #'find-tag) + (let ((tag (funcall (or find-tag-default-function + (get major-mode 'find-tag-default-function) + #'find-tag-default)))) + (unless tag (user-error "No tag candidate found around point")) + (find-tag tag)))))) (evil-define-motion evil-lookup () "Look up the keyword at point. |
