From: João Távora Date: Thu, 23 Mar 2023 17:34:46 +0000 (+0000) Subject: Eglot: don't send invisible text to Eldoc X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fe8af4eb30b81d34bea3f3d982a9167acc8e19e1;p=emacs.git Eglot: don't send invisible text to Eldoc Eglot's rendering of Markdown is imperfect and based on gfm-view-mode. To make it slightly better, don't send invisible text in eglot-hover-eldoc-function. * lisp/progmodes/eglot.el (eglot--format-markup): Hide invisible text. --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 919f44a2d9a..fae1c8db8b7 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1653,10 +1653,15 @@ Doubles as an indicator of snippet support." (setq-local markdown-fontify-code-blocks-natively t) (insert string) (let ((inhibit-message t) - (message-log-max nil)) - (ignore-errors (delay-mode-hooks (funcall mode)))) - (font-lock-ensure) - (string-trim (buffer-string))))) + (message-log-max nil) + match) + (ignore-errors (delay-mode-hooks (funcall mode))) + (font-lock-ensure) + (goto-char (point-min)) + (while (setq match (text-property-search-forward 'invisible)) + (delete-region (prop-match-beginning match) + (prop-match-end match))) + (string-trim (buffer-string)))))) (define-obsolete-variable-alias 'eglot-ignored-server-capabilites 'eglot-ignored-server-capabilities "1.8")