@@ -402,7 +402,7 @@ impl<'a> TextRenderer<'a> {
402402 is_in_indent_area: &mut bool,
403403 position: Position,
404404 ) {
405− let cut_off_start = self.col_offset.saturating_sub(position.col as usize);
405+ let cut_off_start = self.col_offset.saturating_sub(position.col);
406406 let is_whitespace = grapheme.is_whitespace();
407407
408408 // TODO is it correct to apply the whitspace style to all unicode white spaces?
@@ -413,7 +413,7 @@ impl<'a> TextRenderer<'a> {
413413 let width = grapheme.width();
414414 let grapheme = match grapheme {
415415 Grapheme::Tab { width } => {
416− let grapheme_tab_width = char_to_byte_idx(&self.tab, width as usize);
416+ let grapheme_tab_width = char_to_byte_idx(&self.tab, width);
417417 &self.tab[..grapheme_tab_width]
418418 }
419419 // TODO special rendering for other whitespaces?
@@ -423,8 +423,8 @@ impl<'a> TextRenderer<'a> {
423423 Grapheme::Newline => &self.newline,
424424 };
425425
426− let in_bounds = self.col_offset <= (position.col as usize)
427− && (position.col as usize) < self.viewport.width as usize + self.col_offset;
426+ let in_bounds = self.col_offset <= position.col
427+ && position.col < self.viewport.width as usize + self.col_offset;
428428
429429 if in_bounds {
430430 self.surface.set_string(
@@ -433,10 +433,10 @@ impl<'a> TextRenderer<'a> {
433433 grapheme,
434434 style,
435435 );
436− } else if cut_off_start != 0 && cut_off_start < width as usize {
436+ } else if cut_off_start != 0 && cut_off_start < width {
437437 // partially on screen
438438 let rect = Rect::new(
439− self.viewport.x as u16,
439+ self.viewport.x,
440440 self.viewport.y + position.row as u16,
441441 (width - cut_off_start) as u16,
442442 1,