on master help sign in
Fix a scrolling crash where it would jump past the end of the buffer.
commitd0530fb83921acc92cd51fd6fa3a8d4846ad5aec authorBlaž Hrastnik <blaz@mxxn.io> dateMon 22 Mar 2021, 18:06 (6 years ago) parent73c92a0
2 files changed+2−1
helix-core/src/auto_pairs.rs+1 helix-term/src/commands.rs+1−1
helix-core/src/auto_pairs.rs+1
@@ -54,6 +54,7 @@ fn next_char(doc: &Rope, pos: usize) -> Option<char> {
5454 }
5555 Some(doc.char(pos))
5656}
57+// TODO: selections should be extended if range, moved if point.
5758
5859// TODO: if not cursor but selection, wrap on both sides of selection (surround)
5960fn handle_open(
helix-term/src/commands.rs+1−1
@@ -433,7 +433,7 @@ fn scroll(view: &mut View, offset: usize, direction: Direction) {
433433 // clamp into viewport
434434 let line = (view.first_line + cursor_off).clamp(
435435 view.first_line + scrolloff,
436− view.first_line + view.last_line().saturating_sub(scrolloff),
436+ view.last_line().saturating_sub(scrolloff),
437437 );
438438
439439 let pos = pos_at_coords(text, Position::new(line, cursor.col)); // this func will properly truncate to line end