From 81385edb7132461500f229919c074e329f42b009 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Fri, 24 Apr 2020 15:39:16 +0100 Subject: [PATCH] Don't reupdate help buffer if already rendered * eglot.el (eglot--update-doc): Don't reupdate if doc buffer already exists. GitHub-reference: fix https://github.com/joaotavora/eglot/issues/445 --- lisp/progmodes/eglot.el | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 6d6f91f55aa..ce4f19c65c2 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/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)) -- 2.39.2