The documentation of Face Attributes suggests that adding a
-n to the box attribute will
draw a line of width n whose top and bottom parts occupy the space of the underlying text, thus avoiding any increase in the character height.
So I've added the following line to my personal theme file for isearch candidates (
`(lazy-highlight ((,class (:box (:line-width -1 :color ,search) :background ,bg1 :foreground ,fg1))))
This works fine considering the height, however, the text width changes as seen in the gif below:
Is there any way to make left and the right part of the box also occupy the underlying text so that there is no change in the text width?