@@ -207,16 +207,19 @@ pub fn render_text<'t>(
207207 it
208208 } else {
209209 let mut last_pos = formatter.visual_pos();
210− last_pos.col -= 1;
211− // check if any positions translated on the fly (like cursor) are at the EOF
212− translate_positions(
213− char_pos + 1,
214− first_visible_char_idx,
215− translated_positions,
216− text_fmt,
217− renderer,
218− last_pos,
219− );
210+ if last_pos.row >= row_off {
211+ last_pos.col -= 1;
212+ last_pos.row -= row_off;
213+ // check if any positions translated on the fly (like cursor) are at the EOF
214+ translate_positions(
215+ char_pos + 1,
216+ first_visible_char_idx,
217+ translated_positions,
218+ text_fmt,
219+ renderer,
220+ last_pos,
221+ );
222+ }
220223 break;
221224 };
222225