Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative lead overlay creation strategy #208

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Koekelas
Copy link

@Koekelas Koekelas commented Mar 6, 2021

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

An empty overlay is created when the buffer is empty (no need to
modify the buffer), the overlay is positioned before a tab (no
horizontal shift of the line when the character width of the lead face
differs from that of the underlying face) or it is positioned before a
new line. Additionally, only the path is fontified (no full width tab
or line when the lead face specifies a background) and a priority is
specified (no fighting with other overlays, see abo-abo#98 and abo-abo#178).

* ace-window.el
(aw--make-lead): New function.
(aw--done, aw--lead-overlay): Adapt accordingly.
(aw-empty-buffers-list, aw--overlay-str): Delete definitions.
protesilaos added a commit to protesilaos/modus-themes that referenced this pull request Mar 7, 2021
The plan is to add a background colour to 'aw-leading-char-face', though
this cannot be done before an issue with the overlay's properties is
addressed upstream: <abo-abo/ace-window#208>.

This commit follows from the discussion with Nicolas De Jaeghere in
merge require 27: <https://gitlab.com/protesilaos/modus-themes/-/merge_requests/27>.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant