Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrolling Bufferline #8362

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Small cleanup
  • Loading branch information
CedricMeu committed Jun 21, 2024
commit 319a0025e31ec5727a77106852271ea3e5e35f5b
4 changes: 2 additions & 2 deletions helix-term/src/ui/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ impl EditorView {
let max_displacement = (full_width - viewport.width as i32).max(0);

// This part clamps the scrolling of the bufferline to the right of the viewport.
let displacement = right_of_center.min(max_displacement).max(0);
let displacement = right_of_center.clamp(0, max_displacement);

// If there's any displacement, there's underflow of the bufferline.
let mark_underflow = displacement > 0;
Expand All @@ -678,7 +678,7 @@ impl EditorView {
let mark_overflow = displacement < max_displacement;

for tab in buffertabs.iter_mut() {
tab.x = tab.x.saturating_sub(displacement.abs());
tab.x = tab.x.saturating_sub(displacement);
}

// Itterate over buffertabs, skip or slice them if left off screen, stop if right of screen.
Expand Down