summaryrefslogtreecommitdiff
path: root/helix-term/src/commands.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r--helix-term/src/commands.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 31498a7b..4e3c321c 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -870,7 +870,7 @@ fn goto_window(cx: &mut Context, align: Align) {
let config = cx.editor.config();
let (view, doc) = current!(cx.editor);
- let height = view.inner_area().height as usize;
+ let height = view.inner_height();
// respect user given count if any
// - 1 so we have at least one gap in the middle.
@@ -1372,9 +1372,9 @@ pub fn scroll(cx: &mut Context, offset: usize, direction: Direction) {
return;
}
- let height = view.inner_area().height;
+ let height = view.inner_height();
- let scrolloff = config.scrolloff.min(height as usize / 2);
+ let scrolloff = config.scrolloff.min(height / 2);
view.offset.row = match direction {
Forward => view.offset.row + offset,
@@ -1412,25 +1412,25 @@ pub fn scroll(cx: &mut Context, offset: usize, direction: Direction) {
fn page_up(cx: &mut Context) {
let view = view!(cx.editor);
- let offset = view.inner_area().height as usize;
+ let offset = view.inner_height();
scroll(cx, offset, Direction::Backward);
}
fn page_down(cx: &mut Context) {
let view = view!(cx.editor);
- let offset = view.inner_area().height as usize;
+ let offset = view.inner_height();
scroll(cx, offset, Direction::Forward);
}
fn half_page_up(cx: &mut Context) {
let view = view!(cx.editor);
- let offset = view.inner_area().height as usize / 2;
+ let offset = view.inner_height() / 2;
scroll(cx, offset, Direction::Backward);
}
fn half_page_down(cx: &mut Context) {
let view = view!(cx.editor);
- let offset = view.inner_area().height as usize / 2;
+ let offset = view.inner_height() / 2;
scroll(cx, offset, Direction::Forward);
}
@@ -4342,7 +4342,7 @@ fn align_view_middle(cx: &mut Context) {
view.offset.col = pos
.col
- .saturating_sub((view.inner_area().width as usize) / 2);
+ .saturating_sub((view.inner_area(doc).width as usize) / 2);
}
fn scroll_up(cx: &mut Context) {