-
-
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
Fix: indent guides out of bound. #3105
Conversation
when Insufficient width of split window
&indent_guide_char, | ||
indent_style, | ||
); | ||
} |
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 would think.. once it goes out_of_bounds
the next indent_level can not suddenly be inside again.. or ??
} | |
} else { | |
break; | |
} |
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.
thanks , i test this, If use break, the indents of the next level will not be rendered.
…ion directly next time
if i < hide_indent_level { | ||
continue; | ||
} | ||
|
||
let visual_x = i * tab_width as u16; | ||
let out_of_bounds = | ||
visual_x < offset.col as u16 || visual_x >= viewport.width + offset.col as u16; |
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 seems overly complicated to me, you should be able to calculate the starting indent level outside the for loop then for i in starting_level..(indent_level / tab_width as u16)
to start rendering at the right offset.
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.
It's not about the starting level.. it's about stopping and not exceeding as I understand.
Possibly, once the right limit has been found, code can be further optimized to reuse this value.
As the guides are an optional feature, optimization should not bleed into normal codeflow.
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.
It's about the starting level. The code is rendering the right split's indent guides, but since the starting column is further in the file it's rendering them off screen into the previous split.
Addressed in 906259c |
Fixes helix-editor#3087 Refs helix-editor#3105 # modified: theme.toml
Fixes helix-editor#3087 Refs helix-editor#3105 # modified: theme.toml
when Insufficient width of split window