Skip to content

Commit

Permalink
Hide inlay hint overlays before revert buffer.
Browse files Browse the repository at this point in the history
  • Loading branch information
manateelazycat committed Sep 7, 2024
1 parent 8d0e32e commit 58da592
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lsp-bridge.el
Original file line number Diff line number Diff line change
Expand Up @@ -2638,10 +2638,12 @@ We need exclude `markdown-code-fontification:*' buffer in `lsp-bridge-monitor-be

;; We use `lsp-bridge-revert-buffer-flag' var avoid lsp-bridge send change_file request while execute `revert-buffer' command.
(defun lsp-bridge--revert-buffer-advisor (orig-fun &optional arg &rest args)
;; We need clean diagnostic overlays before revert action,
;; otherwise some diagnostic overlays will keep in buffer after revert.
;; We need clean diagnostic overlays before revert buffer.
(lsp-bridge-diagnostic-hide-overlays)

;; Hide inlay hint overlays before revert buffer.
(lsp-bridge-inlay-hint-hide-overlays)

(setq-local lsp-bridge-revert-buffer-flag t)
(apply orig-fun arg args)
(setq-local lsp-bridge-revert-buffer-flag nil))
Expand Down

0 comments on commit 58da592

Please sign in to comment.