Skip to content

Commit

Permalink
fix: Indent levels could bleed over on the left edge
Browse files Browse the repository at this point in the history
Fixes #3087
Refs #3105
    #	modified:   theme.toml
  • Loading branch information
archseer committed Jul 20, 2022
1 parent 3b1ba7f commit 906259c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion helix-term/src/ui/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,11 @@ impl EditorView {
return;
}

for i in 0..(indent_level / tab_width as u16) {
let starting_indent = (offset.col / tab_width) as u16;
// TODO: limit to a max indent level too. It doesn't cause visual artifacts but it would avoid some
// extra loops if the code is deeply nested.

for i in starting_indent..(indent_level / tab_width as u16) {
surface.set_string(
viewport.x + (i * tab_width as u16) - offset.col as u16,
viewport.y + line,
Expand Down

0 comments on commit 906259c

Please sign in to comment.