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

    When user declines to reconnect, first quit existing server
    
    * eglot.el (eglot): Rework reconnection logic.
---
 eglot.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/eglot.el b/eglot.el
index c5a0c0f..3d0c044 100644
--- a/eglot.el
+++ b/eglot.el
@@ -293,13 +293,15 @@ Execute program (or connect to <host>:<port>) "
                   (y-or-n-p "[eglot] Live process found, reconnect instead? "))
              (eglot-reconnect current-process interactive))
             (t
+             (when (process-live-p current-process)
+               (eglot-shutdown current-process 'sync))
              (eglot--connect
               project
               managed-major-mode
               short-name
               command
               (lambda (proc)
-                (eglot--message "Connected! Process `%s' now managing `%s'\
+                (eglot--message "Connected! Process `%s' now managing `%s' \
 buffers in project %s."
                                 proc
                                 managed-major-mode

Reply via email to