branch: externals/elpa
commit e1e7362e7af4e074584c703355e6126404a99066
Author: João Távora <joaotav...@gmail.com>
Commit: João Távora <joaotav...@gmail.com>

    Fix #445: don't reupdate help buffer if already rendered
    
    * eglot.el (eglot--update-doc): Don't reupdate if doc buffer
    already exists.
---
 eglot.el | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/eglot.el b/eglot.el
index 6d6f91f..ce4f19c 100644
--- a/eglot.el
+++ b/eglot.el
@@ -2252,11 +2252,13 @@ potentially rename EGLOT's help buffer."
           (and eglot-put-doc-in-help-buffer
                (funcall eglot-put-doc-in-help-buffer string)))
       (with-current-buffer (eglot--help-buffer)
-        (rename-buffer (format "*eglot-help for %s*" hint))
-        (let ((inhibit-read-only t))
-          (erase-buffer)
-          (insert string)
-          (goto-char (point-min))
+        (let ((inhibit-read-only t)
+              (name (format "*eglot-help for %s*" hint)))
+          (unless (string= name (buffer-name))
+            (rename-buffer (format "*eglot-help for %s*" hint))
+            (erase-buffer)
+            (insert string)
+            (goto-char (point-min)))
           (if eglot-auto-display-help-buffer
               (display-buffer (current-buffer))
             (unless (get-buffer-window (current-buffer))

Reply via email to