emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/elpa 9874456 42/71: Close #482: use filter-buffer-subst


From: João Távora
Subject: [elpa] externals/elpa 9874456 42/71: Close #482: use filter-buffer-substring to get buffer text
Date: Wed, 16 Dec 2020 11:42:22 -0500 (EST)

branch: externals/elpa
commit 987445648a893444ac1bbdfe3035221fa7797b45
Author: Andrii Kolomoiets <andreyk.mad@gmail.com>
Commit: GitHub <noreply@github.com>

    Close #482: use filter-buffer-substring to get buffer text
    
    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'.
---
 eglot.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eglot.el b/eglot.el
index dc0200d..8bb610b 100644
--- a/eglot.el
+++ b/eglot.el
@@ -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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]