on master help sign in
fix position translation at EOF with softwrap (#5786)
commit2949bb018c00e21d0465bab6970708407cc29ccd authorPascal Kuthe <pascal.kuthe@semimod.de> dateThu 2 Feb 2023, 19:04 (4 years ago) parent6ed2348
1 file changed+13−10
helix-term/src/ui/document.rs+13−10
helix-term/src/ui/document.rs+13−10
@@ -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