Skip to content

Commit

Permalink
fix position translation at EOF with softwrap (#5786)
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalkuthe committed Feb 2, 2023
1 parent 6ed2348 commit 2949bb0
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions helix-term/src/ui/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,16 +207,19 @@ pub fn render_text<'t>(
it
} else {
let mut last_pos = formatter.visual_pos();
last_pos.col -= 1;
// check if any positions translated on the fly (like cursor) are at the EOF
translate_positions(
char_pos + 1,
first_visible_char_idx,
translated_positions,
text_fmt,
renderer,
last_pos,
);
if last_pos.row >= row_off {
last_pos.col -= 1;
last_pos.row -= row_off;
// check if any positions translated on the fly (like cursor) are at the EOF
translate_positions(
char_pos + 1,
first_visible_char_idx,
translated_positions,
text_fmt,
renderer,
last_pos,
);
}
break;
};

Expand Down

0 comments on commit 2949bb0

Please sign in to comment.