summaryrefslogtreecommitdiff
path: root/helix-term/src/commands.rs
diff options
context:
space:
mode:
authorPascal Kuthe2023-02-09 22:27:08 +0000
committerGitHub2023-02-09 22:27:08 +0000
commit8a3ec443f176218384db8c8610bbada9c43a6ea5 (patch)
tree5b8ada854a35d6afd530a33943bfacef338d84f8 /helix-term/src/commands.rs
parent9d73a0d1128f8237eef2d4bf475496d4db081df2 (diff)
Fix new clippy lints (#5892)
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r--helix-term/src/commands.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index d7d87b5a..84daaef4 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -959,9 +959,11 @@ fn goto_window(cx: &mut Context, align: Align) {
Align::Bottom => {
view.offset.vertical_offset + last_visual_line.saturating_sub(scrolloff + count)
}
- }
- .max(view.offset.vertical_offset + scrolloff)
- .min(view.offset.vertical_offset + last_visual_line.saturating_sub(scrolloff));
+ };
+ let visual_line = visual_line.clamp(
+ view.offset.vertical_offset + scrolloff,
+ view.offset.vertical_offset + last_visual_line.saturating_sub(scrolloff),
+ );
let pos = view
.pos_at_visual_coords(doc, visual_line as u16, 0, false)