It used to be the reverse way around, which doesn't make sense.
* eglot.el (eglot-managed-mode): Fix order in `kill-buffer-hook'
Co-authored-by: João Távora <joaotavora@gmail.com>
(eglot--managed-mode
(add-hook 'after-change-functions 'eglot--after-change nil t)
(add-hook 'before-change-functions 'eglot--before-change nil t)
- (add-hook 'kill-buffer-hook 'eglot--signal-textDocument/didClose nil t)
(add-hook 'kill-buffer-hook 'eglot--managed-mode-onoff nil t)
+ ;; Prepend "didClose" to the hook after the "onoff", so it will run first
+ (add-hook 'kill-buffer-hook 'eglot--signal-textDocument/didClose nil t)
(add-hook 'before-revert-hook 'eglot--signal-textDocument/didClose nil t)
(add-hook 'before-save-hook 'eglot--signal-textDocument/willSave nil t)
(add-hook 'after-save-hook 'eglot--signal-textDocument/didSave nil t)