Eglot: Simplify overlay handling in manual example
* doc/misc/eglot.texi (Extending Eglot): Simplify. Copyright-paperwork-exempt: yes
This commit is contained in:
parent
e4e89e2cb6
commit
bfb486d802
1 changed files with 2 additions and 4 deletions
|
@ -1405,8 +1405,6 @@ The remainder of the implementation consists of standard Elisp
|
|||
techniques to loop over arrays, manage buffers and overlays.
|
||||
|
||||
@lisp
|
||||
(defvar-local eglot-clangd-inactive-region-overlays '())
|
||||
|
||||
(cl-defmethod eglot-handle-notification
|
||||
(_server (_method (eql textDocument/inactiveRegions))
|
||||
&key regions textDocument &allow-other-keys)
|
||||
|
@ -1414,14 +1412,14 @@ techniques to loop over arrays, manage buffers and overlays.
|
|||
(cl-getf textDocument :uri))))
|
||||
(buffer (find-buffer-visiting path)))
|
||||
(with-current-buffer buffer
|
||||
(mapc #'delete-overlay eglot-clangd-inactive-region-overlays)
|
||||
(remove-overlays nil nil 'inactive-code t)
|
||||
(cl-loop
|
||||
for r across regions
|
||||
for (beg . end) = (eglot-range-region r)
|
||||
for ov = (make-overlay beg end)
|
||||
do
|
||||
(overlay-put ov 'face 'shadow)
|
||||
(push ov eglot-clangd-inactive-region-overlays)))))
|
||||
(overlay-put ov 'inactive-code t)))))
|
||||
@end lisp
|
||||
|
||||
@end itemize
|
||||
|
|
Loading…
Add table
Reference in a new issue