]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow read-only modes for markup rendering
authorJoão Távora <joaotavora@gmail.com>
Tue, 1 Jan 2019 14:56:46 +0000 (14:56 +0000)
committerJoão Távora <joaotavora@gmail.com>
Tue, 1 Jan 2019 14:56:46 +0000 (14:56 +0000)
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.

GitHub-reference: close https://github.com/joaotavora/eglot/issues/197

lisp/progmodes/eglot.el

index 2411c6a89c9d9bbf7519b735601c224db6fc1455..4416e52c705cf05c0c0373fa9d12525b9069b675 100644 (file)
@@ -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.