-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 #9256
base: master
Are you sure you want to change the base?
feat: Use custom character to draw editor rulers #9256
Conversation
hmm I am not sure about this one. This will draw over any rendered text (so if you write to the ruler the text there is hidden). A similar issues already occurs with rulers hiding cursors. IMO the right solution is to use the new infrastructure in #6417 and render the rulers before the text and the ruler highlights after the text highlights but before the selection highlights |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also unsure of this but for a different reason. This will introduce some issues with the theming for rulers, sort of opposite of the problem we have now in #5721. Themes should define rulers with background colors rather than foreground colors. If you configure a ruler-char
with this change though you want the ruler's foreground to be themed rather than the background though. So themes will either look wrong if you have ruler-char
set or if you don't.
@@ -273,6 +273,11 @@ pub struct Config { | |||
pub terminal: Option<TerminalConfig>, | |||
/// Column numbers at which to draw the rulers. Defaults to `[]`, meaning no rulers. | |||
pub rulers: Vec<u16>, | |||
|
|||
/// If set, use this character to draw the editor's rulers. | |||
#[serde(rename = "ruler-char")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unnecessary because the struct is tagged with #[serde(rename_all = "kebab-case")]
@@ -149,7 +149,6 @@ pub struct LanguageConfiguration { | |||
/// global setting. | |||
#[serde(default, skip_serializing, deserialize_with = "deserialize_auto_pairs")] | |||
pub auto_pairs: Option<AutoPairs>, | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be reset
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to reformat the tables, let's leave them as-is. Reformatting them inflates the diff and may introduce conflicts with other PRs that touch these docs
Can I continue working on this PR? I want to use character rulers myself a lot. @the-mikedavis, what are the problems right now?
Anything else? |
I played with code a bit and I have some points here, except styling related, since they are trivial:
For now it looks great on my setup, I would like to send PR. I'm not completely happy with rendering code and introducing two separate theme keys tho. So I would appreciate any help. |
I created a PR #11798 and I suggest moving further work there |
This pull request adds functionality requested in #5190.
The user may specify a character that is used when rendering rulers, instead of colouring a line in the editor. The default behaviour is retained - if the user does not specify the ruler character config, the original behaviour is used. This functionality will be useful for users that want to, for example, use a box-drawing character to draw the ruler.
Please feel free to make suggestions and comments on my pull request, as it is my first time contributing to Helix. Additionally, I would like to thank the Helix project for making an awesome piece of software that has helped with my daily tasks.
Example config:
Screenshot: