Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-core/src/position.rs')
| -rw-r--r-- | helix-core/src/position.rs | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/helix-core/src/position.rs b/helix-core/src/position.rs index e70cb949..3f888c57 100644 --- a/helix-core/src/position.rs +++ b/helix-core/src/position.rs @@ -262,14 +262,7 @@ pub fn visual_offset_from_anchor( pub fn pos_at_coords(text: RopeSlice, coords: Position, limit_before_line_ending: bool) -> usize { let Position { mut row, col } = coords; if limit_before_line_ending { - let lines = text.len_lines() - 1; - - row = row.min(if crate::line_ending::get_line_ending(&text).is_some() { - // if the last line is empty, don't jump to it - lines - 1 - } else { - lines - }); + row = row.min(text.len_lines() - 1); }; let line_start = text.line_to_char(row); let line_end = if limit_before_line_ending { |