@@ -516,8 +516,8 @@ impl EditorView {
516 use helix_core::graphemes::{grapheme_width, RopeGraphemes};
516 use helix_core::graphemes::{grapheme_width, RopeGraphemes};
518 for grapheme in RopeGraphemes::new(text) {
518 for grapheme in RopeGraphemes::new(text) {
519− let out_of_bounds = offset.col > (visual_x as usize)
519+ let out_of_bounds = offset.col > visual_x
520− || (visual_x as usize) >= viewport.width as usize + offset.col;
520+ || visual_x >= viewport.width as usize + offset.col;
522 if LineEnding::from_rope_slice(&grapheme).is_some() {
522 if LineEnding::from_rope_slice(&grapheme).is_some() {
523 if !out_of_bounds {
523 if !out_of_bounds {
@@ -547,7 +547,7 @@ impl EditorView {
547 let (display_grapheme, width) = if grapheme == "\t" {
547 let (display_grapheme, width) = if grapheme == "\t" {
548 is_whitespace = true;
548 is_whitespace = true;
549 // make sure we display tab as appropriate amount of spaces
549 // make sure we display tab as appropriate amount of spaces
550− let visual_tab_width = tab_width - (visual_x as usize % tab_width);
550+ let visual_tab_width = tab_width - (visual_x % tab_width);
551 let grapheme_tab_width =
551 let grapheme_tab_width =
552 helix_core::str_utils::char_to_byte_idx(&tab, visual_tab_width);
552 helix_core::str_utils::char_to_byte_idx(&tab, visual_tab_width);
@@ -566,7 +566,7 @@ impl EditorView {
566 (grapheme.as_ref(), width)
566 (grapheme.as_ref(), width)
569− let cut_off_start = offset.col.saturating_sub(visual_x as usize);
569+ let cut_off_start = offset.col.saturating_sub(visual_x);
571 if !out_of_bounds {
571 if !out_of_bounds {
572 // if we're offscreen just keep going until we hit a new line
572 // if we're offscreen just keep going until we hit a new line
@@ -583,7 +583,7 @@ impl EditorView {
583 } else if cut_off_start != 0 && cut_off_start < width {
583 } else if cut_off_start != 0 && cut_off_start < width {
584 // partially on screen
584 // partially on screen
585 let rect = Rect::new(
585 let rect = Rect::new(
586− viewport.x as u16,
586+ viewport.x,
587 viewport.y + line,
587 viewport.y + line,
588 (width - cut_off_start) as u16,
588 (width - cut_off_start) as u16,