helix-editor / helix

A post-modern modal text editor.
https://helix-editor.com
Mozilla Public License 2.0
33.46k stars 2.48k forks source link

Not all themes display rulers #5721

Closed non-descriptive closed 6 months ago

non-descriptive commented 1 year ago

Summary

themes which do not display rulers

Basically theme doesn't have proper bg color for ui.virtual.ruler or fg color for ui.virtual.rulers. Usually they should have either gray color or the same color as ui.cursorline.primary

Reproduction Steps

  1. setup editor.rulers value.
  2. set theme to one in the list above

Helix log

No response

Platform

Windows

Terminal Emulator

Windows Terminal

Helix Version

helix 22.12 (4d548a0e)

the-mikedavis commented 1 year ago

Except for kanagawa, these all use foreground rulers. The default and rasmus set ui.virtual to a foreground color which makes sense for some scopes like ui.virtual.indent-guide or ui.virtual.whitespace. I think those are probably oversights and could be updated.

Solarized light and dark set ui.virtual.ruler to a foreground color explicitly which I think is a stylistic choice: foreground rulers are visible if you have lines that cross them. Foreground rulers can be useful because you can see when lines are too long without the ruler constantly being visible.

Kanagawa has a background ruler though. It looks to me like it's displaying a ruler.

non-descriptive commented 1 year ago

I fixed some themes locally and didn't test others, just noticed there's no rulers were displayed. Also it's kinda weird way to separate rulers - themes differentiate ruler and rulers keywords. One of it works with background color and another one with foreground color.

tqwewe commented 1 year ago

Updated list of themes which do not display rulers:

pieqq commented 1 year ago

I think at the very least, the default theme should display both foreground and background rulers. I wanted to display rulers the way I was used to in vim (what is called background rulers in Helix apparently), so I added

[editor]
rulers = [80]

in my config.toml, and yet nothing showed up. Sure, if lines go beyond 80 characters, the character placed at column 80 will be in a different color, but:

Only this morning did I figure this out when trying other themes! :)

(by the way, the live preview when running :theme <tab><tab> is amazing!!)

ardrigh commented 10 months ago

I just noticed this on the default theme in Helix. I had set a ruler for 100 characters, and when I was typing the character changed colour, but the vertical bar isn't visible.

There is no indication the ruler has been set correctly based on the configuration.

This then looks like a rendering bug to the user in Helix displaying one character in a different colour.

I am not sure why there needs to be fancy foreground and background separation, but in at least the default theme, Helix should act the same as other editors using background colour visible vertical ruler lines on screen.

If people wanted to have smart foreground colours about text beyond rulers, they should really theme all text beyond the ruler in the different colour, not a single character.

non-descriptive commented 10 months ago

There are foreground and background colors, you probably set only foreground which changes font color.

pieqq commented 10 months ago

There are foreground and background colors, you probably set only foreground which changes font color.

That's the issue here: we are talking about the default theme. I think at the very least the default theme should have both background and foreground set up for the rulers in order to have a nice default experience. User can then move on to another theme if they wish so :)

ulmer-a commented 10 months ago

Is anything holding back this issue? Otherwise, I could probably fix this. Should the respective themes just be fixed or should helix just assume a default of, e.g., ui.cursorline.primary if a theme doesn't specify a ui.virtual.ruler?

the-mikedavis commented 10 months ago

We just need to figure out if these themes are using foreground rulers intentionally or if it'd be ok to switch to background. If you'd like to make a PR that switches these to background rulers we can tag the theme authors and ask