-
-
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
Indent guides should not extend beyond the last line #8487
Comments
So, helix should add a option which will toggle this behavior and depending on the file-type enable this behavior. Languages such as Python would enable this. It could be enabled for any file optionally. How difficult would be to implement this? |
helix/helix-term/src/ui/document.rs Line 154 in a857480
It would be better to tackle this issue directly instead if it's possible within the current rendering system. What you're talking about is #8054 I think the cause of this behavior is that we currently depend on whitespace at the beginning of the line to determine whether to draw an indent guide. One way I think this could be done is to add additional scopes to |
Could tree-sitter be used for determining where to draw them? |
I don't think we should start using TS for indent guides. I think the specific of how we render them is simply not ideal. We continue the indentation of the previous line across emply and whitespace only line. Instead we should:
This is how other editors/vim plugins handle this. That approach would also allow us to do some lookahead to avoid indent guides disappearing at the first/last lines as they currently do. |
yes that is exactly the intention. Helix also removes trailing indentation when leaving insert mode (if the line is empty on the cursor line). This ensures that the indent guides both behave correctly and use the trailing indentation (the indentatino of the next non-emtpy line) while also making sure that lines which are manually indented but don't contain text yet (lime after hitting I don't think the case you show should be fixed. Indentguides are not meant to show somekind of "language level scope& or similar. They are supped to show how many times you need to press tab to reach te same indentatino. They are purely textual and I don't think that should change. |
What does "trailing indentation" mean in this context? |
The indentation of the first non-empty line after an empty lines |
Indent guides should stop at the last non-empty line inside an indented block in languages which use indentation for structure.
left: what helix does currently.
right: what helix should do.
The text was updated successfully, but these errors were encountered: