on master help sign in
fix position translation at EOF with softwrap (#5786)
2949bb0Pascal Kuthe
helix-term/src/ui/document.rs+13−10
@@ -207,16 +207,19 @@ pub fn render_text<'t>(
207 it
207 it
208 } else {
208 } else {
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,
219− );
221+ );
222+ }
220 break;
223 break;
221 };
224 };
222
225