Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Configure what character is used to draw the ruler #5190

Closed
aspizu opened this issue Dec 17, 2022 · 5 comments
Closed

Configure what character is used to draw the ruler #5190

aspizu opened this issue Dec 17, 2022 · 5 comments
Labels
A-helix-term Area: Helix term improvements C-enhancement Category: Improvements

Comments

@aspizu
Copy link

aspizu commented Dec 17, 2022

Instead of drawing a filled column, optionally
draw a column with the configured character.
This then could be set to a box-drawing character
to get a line as a ruler.

@aspizu aspizu added the C-enhancement Category: Improvements label Dec 17, 2022
@archseer
Copy link
Member

It's deliberately not a character so it doesn't obscure the text though

@aspizu
Copy link
Author

aspizu commented Dec 18, 2022

this would be optional though

@dgkf
Copy link
Contributor

dgkf commented Dec 19, 2022

I just wanted to chime in to say that I see the value here. I've been using TUI-based text editors for years and I still second-guess whether my ruler markings are the last column of my preferred width or the first column of overflow.

Using a box-drawing character helps make this less ambiguous.

But I also agree with @archseer that this loses some information, for example in cases where almost all lines overflow a ruler.

One alternative I had in mind would be to permit ranges in the ruler config. If 80 is a preferred linewidth, then this makes it more obvious that 81 is the start of a region of overflow, not the end of acceptable widths. The example below would use the ruler style for all columns >=81.

[editor]
rulers = [ 81.. ]

Granted, this isn't valid toml so the syntax would need to be workshopped.

What do you think @aspizu?

@aspizu
Copy link
Author

aspizu commented Dec 19, 2022

[editor]
ruler-char = "" # defaults to null which means draw bg color
rulers = [10, 20, 30] # rulers are rendered with ${ruler-char}
margin = 81 # col<=81 are rendered with bg color
# defaults to null which doesnt draw a margin

@dylangiles
Copy link

Howdy all, I have opened PR #9256 that adds this functionality using the config syntax @aspizu suggested. It is opt-in - if the config key is not provided the original behaviour for rulers is used

@helix-editor helix-editor locked and limited conversation to collaborators Apr 7, 2024
@pascalkuthe pascalkuthe converted this issue into discussion #10217 Apr 7, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
A-helix-term Area: Helix term improvements C-enhancement Category: Improvements
Projects
None yet
Development

No branches or pull requests

5 participants