branch: externals/eglot
commit e65792fc4313ee7143efc6c133c5824be4fb7db2
Author: João Távora <[email protected]>
Commit: João Távora <[email protected]>

    Close #197: allow read-only modes for markup rendering
    
    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.
---
 eglot.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eglot.el b/eglot.el
index 2411c6a..4416e52 100644
--- a/eglot.el
+++ b/eglot.el
@@ -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.

Reply via email to