Skip to content

Commit

Permalink
Add scrolling down past half the buffer height
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmoulton committed Dec 19, 2022
1 parent ba3c24a commit 4155026
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion helix-term/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1380,7 +1380,7 @@ pub fn scroll(cx: &mut Context, offset: usize, direction: Direction) {
let last_line = view.last_line(doc);

if direction == Backward && view.offset.row == 0
|| direction == Forward && last_line == doc_last_line
|| !config.scroll_past_bottom && direction == Forward && last_line == doc_last_line
{
return;
}
Expand Down
3 changes: 3 additions & 0 deletions helix-view/src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ pub struct Config {
pub scrolloff: usize,
/// Number of lines to scroll at once. Defaults to 3
pub scroll_lines: isize,
/// Allow scrolling down past half the buffer height. Defaults to false.
pub scroll_past_bottom: bool,
/// Mouse support. Defaults to true.
pub mouse: bool,
/// Shell to use for shell commands. Defaults to ["cmd", "/C"] on Windows and ["sh", "-c"] otherwise.
Expand Down Expand Up @@ -594,6 +596,7 @@ impl Default for Config {
Self {
scrolloff: 5,
scroll_lines: 3,
scroll_past_bottom: false,
mouse: true,
shell: if cfg!(windows) {
vec!["cmd".to_owned(), "/C".to_owned()]
Expand Down

0 comments on commit 4155026

Please sign in to comment.