Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions lsp-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -4866,6 +4866,13 @@ Added to `before-change-functions'."
(lsp:text-document-sync-options-change? sync)
sync)))

(defvaralias 'lsp--revert-buffer-in-progress
(if (boundp 'revert-buffer-in-progress)
'revert-buffer-in-progress
'revert-buffer-in-progress-p)
"Alias for `revert-buffer-in-progress' if available, or `revert-buffer-in-progress-p'
prior to emacs 31.")

(defun lsp-on-change (start end length &optional content-change-event-fn)
"Executed when a file is changed.
Added to `after-change-functions'."
Expand Down Expand Up @@ -4893,7 +4900,7 @@ Added to `after-change-functions'."
;; buffer-file-name. We need the buffer-file-name to send notifications;
;; so we skip handling revert-buffer-caused changes and instead handle
;; reverts separately in lsp-on-revert
(when (not revert-buffer-in-progress-p)
(when (not lsp--revert-buffer-in-progress)
(cl-incf lsp--cur-version)
(mapc
(lambda (workspace)
Expand Down Expand Up @@ -5184,7 +5191,7 @@ one of the LANGUAGES."
"Executed when a file is reverted.
Added to `after-revert-hook'."
(let ((n (buffer-size))
(revert-buffer-in-progress-p nil))
(lsp--revert-buffer-in-progress nil))
(lsp-on-change 0 n n)))

(defun lsp--text-document-did-close (&optional keep-workspace-alive)
Expand Down
Loading