-
Notifications
You must be signed in to change notification settings - Fork 45
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
refill
ing single-line (Rust) comments
#524
Comments
Hey @bonsairobo, I took a quick peek at your branch and we could add However, I feel it would be wrong for a text editor to use For a text editor, I would expect that you need and want more control, so I would recommend using the more low-level wrapping infrastructure in Textwrap directly. That is, implement your own But of course, if you tell me that I'll be happy to extend |
@mgeisler Thanks for the quick reply.
I trust your opinion here. I can see how a text editor would want more control as it evolves to support more features.
I am not sure yet. It seems like the closest thing, and it's what Helix currently uses, but it does make enough assumptions that I worry the Helix use case could outgrow the FWIW, I doubt Helix would want to use proportional fonts, being a terminal text editor. But I am not a Helix maintainer so take my words with a grain of salt.
OK, only if you think it's a good change overall, not just for my sake. In summary, I will take a look at the |
After looking at the |
I'm also fairly certain that We have options:
|
In that case, then let's go for your second option:
I would be happy to make the function fit your use case better. I implemented the function one day when I realized that I mostly had the infrastructure to do so... but I didn't actually have a use case for it myself 😄 If you need a breaking API change, then we just make a 0.18 release of the library. I would probably like to also hide the public |
@mgeisler OK I think I will make another post in the Helix issue to make sure this decision is agreeable before doing more work on it. Just want to avoid going too far and ultimately getting a PR rejected b/c maintainers have other ideas. |
As discussed here: helix-editor/helix#2128 (comment)
To support
refill
ing single-line Rust comments (as desired in this helix issue), the most flexible proposal I've seen is to provide a list of know prefixes, e.g.["//", "///", "//!"]
, and then if one of these prefixes is identified on a single line input text, propagateinitial_indent
tosubsequent_indent
.FWIW I created this branch that does the indent propagation without any public function signature changes. All tests pass, but I figured there might be some cases where this isn't flexible enough. I'd love to get some feedback on cases where this solution would be insufficient.
The text was updated successfully, but these errors were encountered: