Skip to content

Commit

Permalink
Close #197: allow read-only modes for markup rendering
Browse files Browse the repository at this point in the history
gfm-mode is read-only, so it must be set after the string has been
inserted in the temporary buffer.

* eglot.el (eglot--format-markup): Insert string before setting
mode.
  • Loading branch information
joaotavora committed Jan 1, 2019
1 parent 7b0d845 commit e65792f
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 @@ -1030,8 +1030,8 @@ Doubles as an indicator of snippet support."
(list (plist-get markup :value)
major-mode))))
(with-temp-buffer
(ignore-errors (funcall mode))
(insert string) (font-lock-ensure) (buffer-string))))
(insert string)
(ignore-errors (funcall mode)) (font-lock-ensure) (buffer-string))))

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

0 comments on commit e65792f

Please sign in to comment.