Fix +lookup/file in non-file-visiting buffers

Throws a stringp error is buffer-file-name is nil.

Reported by @myme
This commit is contained in:
Henrik Lissner 2018-06-22 13:42:47 +02:00
parent 4ad9e18135
commit 25bc9cfbaf
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -245,7 +245,7 @@ Otherwise, falls back on `find-file-at-point'."
((not (and +lookup-file-functions
(+lookup--jump-to :file path)))
(let ((fullpath (expand-file-name path)))
(when (file-equal-p fullpath buffer-file-name)
(when (and buffer-file-name (file-equal-p fullpath buffer-file-name))
(user-error "Already here"))
(let* ((insert-default-directory t)
(project-root (doom-project-root 'nocache))