]> git.eshelyaron.com Git - emacs.git/commit
Improve ergonomics of Eglot's inlay hints
authorJoão Távora <joaotavora@gmail.com>
Sun, 19 Mar 2023 00:47:55 +0000 (00:47 +0000)
committerJoão Távora <joaotavora@gmail.com>
Sun, 19 Mar 2023 19:53:00 +0000 (19:53 +0000)
commit5bbbd70f56e703a18a28666cf12b28e02ffc241f
treebc654421046594ca9ac55b8c0141bb2913e638fa
parentc3a543123abeb8542f50fdd5068a4efe380634ec
Improve ergonomics of Eglot's inlay hints

Instead of deleting inlay hints instantly as soon as the affected
changes, make hint overlays span one character (instead of being
length 0).  Give the overlays an "evaporate" property.

Given an inlay hints at position POS, its attached to [POS, POS+1] if
it's kind=1 (usually type hints) and [POS-1, POS] otherwise.  For
kind=1 hints, the 'cursor position of the first such overlay is also
tweaked, so that's it's less akward to edit around it.

* lisp/progmodes/eglot.el (eglot--before-change): Don't delete hints
  here.
  (eglot--update-hints-1): Rework.
lisp/progmodes/eglot.el