abo-abo / ace-window

Quickly switch windows in Emacs
984 stars 87 forks source link

Alternative lead overlay creation strategy #208

Open Koekelas opened 3 years ago

Koekelas commented 3 years ago

I originally intended to squelch a visual discrepancy, namely the fontification of the newline when the lead overlay is positioned before an empty line:

image

but ended up doing a bit more. Specifically, an empty overlay is created when it is to be placed in an empty buffer, positioned before a tab or positioned before a newline. This has some advantages.

In the case of the empty buffer, the buffer doesn't need to be modified to place the overlay. In the case of the tab, the overlay doesn't horizontally shift the line when the character width (font height) of the lead face differs from that of the underlying face (see screenshot below, indented lines stay vertically aligned). In the case of the newline. Well, mmm, one doesn't need to add a newline to the path? It certainly squelches my visual discrepancy.

Additionally, a priority is specified to prevent fighting with other overlays, see #98 and #178 and a similar issue with show-smartparens-mode (see screenshot below, the overlay isn't affected by smartparens).

I have assigned copyright.

image