Skip to content

Commit

Permalink
Refactor eglot--managed-mode enabling
Browse files Browse the repository at this point in the history
  • Loading branch information
rbrtb committed Apr 30, 2022
1 parent 7f1f093 commit c198ea9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions eglot.el
Original file line number Diff line number Diff line change
Expand Up @@ -1047,8 +1047,9 @@ INTERACTIVE is t if called interactively."
()
(remove-hook 'post-command-hook #'maybe-connect nil)
(eglot--when-live-buffer buffer
(unless eglot--managed-mode
(apply #'eglot--connect (eglot--guess-contact))))))
(unless (eglot-current-server)
(apply #'eglot--connect (eglot--guess-contact)))
(eglot--maybe-activate-editing-mode))))
(when buffer-file-name
(add-hook 'post-command-hook #'maybe-connect 'append nil)))))

Expand Down Expand Up @@ -1723,9 +1724,6 @@ If it is activated, also signal textDocument/didOpen."
(eglot--managed-mode)
(eglot--signal-textDocument/didOpen))))

(add-hook 'find-file-hook 'eglot--maybe-activate-editing-mode)
(add-hook 'after-change-major-mode-hook 'eglot--maybe-activate-editing-mode)

(defun eglot-clear-status (server)
"Clear the last JSONRPC error for SERVER."
(interactive (list (eglot--current-server-or-lose)))
Expand Down

0 comments on commit c198ea9

Please sign in to comment.