on master help sign in
Fix a scrolling crash where it would jump past the end of the buffer.
d0530fbBlaž Hrastnik
helix-core/src/auto_pairs.rs+1
@@ -54,6 +54,7 @@ fn next_char(doc: &Rope, pos: usize) -> Option<char> {
54 }
54 }
55 Some(doc.char(pos))
55 Some(doc.char(pos))
56}
56}
57+// TODO: selections should be extended if range, moved if point.
57
58
58// TODO: if not cursor but selection, wrap on both sides of selection (surround)
59// TODO: if not cursor but selection, wrap on both sides of selection (surround)
59fn handle_open(
60fn handle_open(
helix-term/src/commands.rs+1−1
@@ -433,7 +433,7 @@ fn scroll(view: &mut View, offset: usize, direction: Direction) {
433 // clamp into viewport
433 // clamp into viewport
434 let line = (view.first_line + cursor_off).clamp(
434 let line = (view.first_line + cursor_off).clamp(
435 view.first_line + scrolloff,
435 view.first_line + scrolloff,
436− view.first_line + view.last_line().saturating_sub(scrolloff),
436+ view.last_line().saturating_sub(scrolloff),
437 );
437 );
438
438
439 let pos = pos_at_coords(text, Position::new(line, cursor.col)); // this func will properly truncate to line end
439 let pos = pos_at_coords(text, Position::new(line, cursor.col)); // this func will properly truncate to line end