fix(lookup): strip text properties from error message

Otherwise the error will display a lot of (albeit harmless) gibberish to
the end user.

Fix: #5652
This commit is contained in:
Henrik Lissner 2021-11-21 15:57:58 +01:00
parent 616956ac94
commit 8e13bc68c7

View file

@ -329,7 +329,7 @@ evil-mode is active."
current-prefix-arg))
(cond ((null identifier) (user-error "Nothing under point"))
((+lookup--jump-to :definition identifier nil arg))
((error "Couldn't find the definition of %S" identifier))))
((user-error "Couldn't find the definition of %S" (substring-no-properties identifier)))))
;;;###autoload
(defun +lookup/implementations (identifier &optional arg)
@ -341,7 +341,7 @@ the point or current buffer."
current-prefix-arg))
(cond ((null identifier) (user-error "Nothing under point"))
((+lookup--jump-to :implementations identifier nil arg))
((error "Couldn't find the implementations of %S" identifier))))
((user-error "Couldn't find the implementations of %S" (substring-no-properties identifier)))))
;;;###autoload
(defun +lookup/type-definition (identifier &optional arg)
@ -353,7 +353,7 @@ the point or current buffer."
current-prefix-arg))
(cond ((null identifier) (user-error "Nothing under point"))
((+lookup--jump-to :type-definition identifier nil arg))
((error "Couldn't find the definition of %S" identifier))))
((user-error "Couldn't find the definition of %S" (substring-no-properties identifier)))))
;;;###autoload
(defun +lookup/references (identifier &optional arg)
@ -366,7 +366,7 @@ search otherwise."
current-prefix-arg))
(cond ((null identifier) (user-error "Nothing under point"))
((+lookup--jump-to :references identifier nil arg))
((error "Couldn't find references of %S" identifier))))
((user-error "Couldn't find references of %S" (substring-no-properties identifier)))))
;;;###autoload
(defun +lookup/documentation (identifier &optional arg)
@ -378,7 +378,7 @@ for the current mode/buffer (if any), then falls back to the backends in
(interactive (list (doom-thing-at-point-or-region)
current-prefix-arg))
(cond ((+lookup--jump-to :documentation identifier #'pop-to-buffer arg))
((user-error "Couldn't find documentation for %S" identifier))))
((user-error "Couldn't find documentation for %S" (substring-no-properties identifier)))))
;;;###autoload
(defun +lookup/file (&optional path)