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

Is there a workaround for shifted characters in variable-pitch-mode? #348

Open
Dima-369 opened this issue Apr 16, 2022 · 1 comment
Open

Comments

@Dima-369
Copy link

I really love variable pitch fonts and try to avoid monospaced fonts where possible.

This is a slight issue with using avy because it uses an overlay to replace characters and it results in the characters being shifted a little bit as the characters have differing widths.
This is often not an issue but is annoying once words start to break differently to the new line.

Here are some screenshots:

image

Here I invoke avy-goto-word-1 and enter character h. In this scenario, I want to jump to hello but as the words break differently the overlay ends up on the next line.

image

As an comparison, this is how PhpStorm does it with the AceJump Lite extension. The overlay does not replace the character behind, but is in that sense a 'real' overlay and has the benefit that the underlying characters are never shifted. Still, it is not perfect as the overlay hints sometimes do not fully occupy the characters below but I don't find that an issue for me.

image

Is something like this possible in Emacs as well or does anyone know of a workaround, so the characters are not shifted for variable pitch fonts?

@Dima-369
Copy link
Author

I wondered if the overlay could be done with (child) frames, like in https://github.com/elizagamedev/power-mode.el for each overlay character. In that case, the characters below are not replaced.

But not sure of the work required to implement that and how negatively it would impact performance.

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

No branches or pull requests

1 participant