Skip to content

Commit

Permalink
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'.

GitHub-reference: close joaotavora/eglot#482
  • Loading branch information
muffinmad authored May 26, 2020
1 parent e14934f commit 5e0cd48
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lisp/progmodes/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 5e0cd48

Please sign in to comment.