Skip to content

Commit

Permalink
Close joaotavora#482: use filter-buffer-substring to get buffer text
Browse files Browse the repository at this point in the history
This way modes used to represent hover info text, such as
gfm-view-mode can e.g. filter out invisible text by providing own
`filter-buffer-substring-function'.

* eglot.el (eglot--format-markup): Use `filter-buffer-substring'.
  • Loading branch information
muffinmad committed May 26, 2020
1 parent ee87519 commit 9874456
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions eglot.el
Original file line number Diff line number Diff line change
Expand Up @@ -1165,10 +1165,10 @@ Doubles as an indicator of snippet support."
(_ major-mode))))))
(with-temp-buffer
(setq-local markdown-fontify-code-blocks-natively t)
(insert (string-trim string))
(insert string)
(ignore-errors (delay-mode-hooks (funcall mode)))
(font-lock-ensure)
(buffer-string))))
(string-trim (filter-buffer-substring (point-min) (point-max))))))

(defcustom eglot-ignored-server-capabilites (list)
"LSP server capabilities that Eglot could use, but won't.
Expand Down

0 comments on commit 9874456

Please sign in to comment.