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

prepend comment token on new line when writing comments #6365

Closed
bindsdev opened this issue Mar 18, 2023 · 1 comment
Closed

prepend comment token on new line when writing comments #6365

bindsdev opened this issue Mar 18, 2023 · 1 comment
Labels
C-enhancement Category: Improvements

Comments

@bindsdev
Copy link

When writing comments such as documentation comments, it is pretty annoying that the comment token (//! or /// in Rust for example) isn't prepended to the next line when ENTER is hit. This can mess up the flow of writing comments as you have to manually type the comment token every time. It would be nice if Helix used the comment token (the one specified by the comment-token field under [[language]] in languages.toml) and prepend it to the next line, with a space, when ENTER is hit.

There would of course be some questions that could arise with this feature. In Rust, for example, there are multiple kinds of comment tokens that start with //. How would Helix handle this? One suggestion of mine would be to somehow check if there is another character after the // prefix and append that to some "buffer" caching the token prefix. This would require some discussion though I believe.

@bindsdev bindsdev added the C-enhancement Category: Improvements label Mar 18, 2023
@gabydd
Copy link
Member

gabydd commented Mar 18, 2023

Duplicate of #1730

@archseer archseer closed this as not planned Won't fix, can't repro, duplicate, stale Mar 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Improvements
Projects
None yet
Development

No branches or pull requests

3 participants