Skip to content

Commit 906259c

Browse files
committed
fix: Indent levels could bleed over on the left edge
Fixes #3087 Refs #3105 # modified: theme.toml
1 parent 3b1ba7f commit 906259c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

helix-term/src/ui/editor.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,11 @@ impl EditorView {
421421
return;
422422
}
423423

424-
for i in 0..(indent_level / tab_width as u16) {
424+
let starting_indent = (offset.col / tab_width) as u16;
425+
// TODO: limit to a max indent level too. It doesn't cause visual artifacts but it would avoid some
426+
// extra loops if the code is deeply nested.
427+
428+
for i in starting_indent..(indent_level / tab_width as u16) {
425429
surface.set_string(
426430
viewport.x + (i * tab_width as u16) - offset.col as u16,
427431
viewport.y + line,

0 commit comments

Comments
 (0)