on master help sign in
allow scrolling past virtual text line
d6c8e0cPascal Kuthe
helix-term/src/commands.rs+5−4
@@ -1489,18 +1489,19 @@ pub fn scroll(cx: &mut Context, offset: usize, direction: Direction) {
1489 &annotations,
1489 &annotations,
1490 );
1490 );
1491
1491
1492− let head;
1492+ let mut head;
1493 match direction {
1493 match direction {
1494 Forward => {
1494 Forward => {
1495+ let off;
1495− head = char_idx_at_visual_offset(
1496+ (head, off) = char_idx_at_visual_offset(
1496 doc_text,
1497 doc_text,
1497 view.offset.anchor,
1498 view.offset.anchor,
1498 (view.offset.vertical_offset + scrolloff) as isize,
1499 (view.offset.vertical_offset + scrolloff) as isize,
1499 0,
1500 0,
1500 &text_fmt,
1501 &text_fmt,
1501 &annotations,
1502 &annotations,
1502− )
1503+ );
1503− .0;
1504+ head += (off != 0) as usize;
1504 if head <= cursor {
1505 if head <= cursor {
1505 return;
1506 return;
1506 }
1507 }