Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-term/src/ui/document.rs')
-rw-r--r--helix-term/src/ui/document.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/helix-term/src/ui/document.rs b/helix-term/src/ui/document.rs
index 79145ba0..ae00ea14 100644
--- a/helix-term/src/ui/document.rs
+++ b/helix-term/src/ui/document.rs
@@ -433,7 +433,7 @@ impl<'a> TextRenderer<'a> {
Grapheme::Newline => &self.newline,
};
- let in_bounds = self.column_in_bounds(position.col + width - 1);
+ let in_bounds = self.column_in_bounds(position.col, width);
if in_bounds {
self.surface.set_string(
@@ -452,7 +452,6 @@ impl<'a> TextRenderer<'a> {
);
self.surface.set_style(rect, style);
}
-
if *is_in_indent_area && !is_whitespace {
*last_indent_level = position.col;
*is_in_indent_area = false;
@@ -461,8 +460,8 @@ impl<'a> TextRenderer<'a> {
width
}
- pub fn column_in_bounds(&self, colum: usize) -> bool {
- self.offset.col <= colum && colum < self.viewport.width as usize + self.offset.col
+ pub fn column_in_bounds(&self, colum: usize, width: usize) -> bool {
+ self.offset.col <= colum && colum + width <= self.offset.col + self.viewport.width as usize
}
/// Overlay indentation guides ontop of a rendered line