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

feat: Use custom character to draw editor rulers #11798

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

Conversation

codingjerk
Copy link

This PR allows selecting custom character to draw editor rulers and it contains fixes and improvements on PR #9256

Differences from previous PR

  1. No unnecessary formatting changes
  2. No unnecessary string allocation for every character drawn
  3. Separate theme key (ui.virtual.ruler.char) if editor.ruler-char is set to allow using different styles for "background ruler" and "character ruler"
  4. Ruler character is drawn under the text

Screenshot

Default theme with config

[editor]
  rulers = [ 40, 60 ]
  ruler-char = "¦"

image

@codingjerk
Copy link
Author

codingjerk commented Sep 30, 2024

I believe I also need to add theme key ui.virtual.ruler.char to every theme in helix.

I believe reasonable value for it is the same as ui.virtual.indent-guide. Using bg from ui.virtual.ruler as fg doesn't work well — in some themes it's pretty hard to see "character rulers" since they're thinner.

I'll wait for reviewers to approve this approach, before adding new key to every theme.

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