Skip to content

Commit

Permalink
Fix #116, #150: don't break in indirect buffers
Browse files Browse the repository at this point in the history
Indirect buffers, such as the ones created by ediff-regions-wordwise,
have eglot enabled but not buffer-file-name.  Resort to the finding
the file-name of the original buffer for these.

* eglot.el (eglot--TextDocumentIdentifier): Work in indirect
buffers.

#116: joaotavora/eglot#116
#150: joaotavora/eglot#150
  • Loading branch information
joaotavora committed Dec 1, 2018
1 parent ba65393 commit 257f330
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lisp/progmodes/eglot.el
Original file line number Diff line number Diff line change
Expand Up @@ -1345,7 +1345,10 @@ THINGS are either registrations or unregisterations."

(defun eglot--TextDocumentIdentifier ()
"Compute TextDocumentIdentifier object for current buffer."
`(:uri ,(eglot--path-to-uri buffer-file-name)))
`(:uri ,(eglot--path-to-uri (or buffer-file-name
(ignore-errors
(buffer-file-name
(buffer-base-buffer)))))))

(defvar-local eglot--versioned-identifier 0)

Expand Down

0 comments on commit 257f330

Please sign in to comment.