The documentation of Face Attributes suggests that adding a line-width of -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):

`(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:

enter image description here

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?

  • Do the columns stay aligned if you highlight everything? – Melioratus Jan 11 at 18:51

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.