Skip to content

Commit

Permalink
On buffer kill, first send didClose then teardown local structures
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ilohmar and joaotavora committed Oct 5, 2019
1 parent d61fdc6 commit 533a12d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lisp/progmodes/eglot.el
Original file line number Diff line number Diff line change
Expand Up @@ -1172,8 +1172,9 @@ and just return it. PROMPT shouldn't end with a question mark."
(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)
Expand Down

0 comments on commit 533a12d

Please sign in to comment.