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