:success-fn (lambda (hints)
(eglot--when-live-buffer buf
(eglot--widening
- (remove-overlays from to 'eglot--inlay-hint t)
+ ;; Overlays ending right at FROM with an
+ ;; `after-string' property logically belong to
+ ;; the (FROM TO) region. Likewise, such
+ ;; overlays ending at TO don't logically belong
+ ;; to it.
+ (dolist (o (overlays-in (1- from) to))
+ (when (and (overlay-get o 'eglot--inlay-hint)
+ (cond ((eq (overlay-end o) from)
+ (overlay-get o 'after-string))
+ ((eq (overlay-end o) to)
+ (overlay-get o 'before-string))
+ (t)))
+ (delete-overlay o)))
(mapc paint-hint hints))))
:deferred 'eglot--update-hints-1)))