aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src/editor.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-view/src/editor.rs')
-rw-r--r--helix-view/src/editor.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs
index 32f5fe86..478f3818 100644
--- a/helix-view/src/editor.rs
+++ b/helix-view/src/editor.rs
@@ -180,7 +180,7 @@ impl Editor {
view.jumps.push(jump);
view.last_accessed_doc = Some(view.doc);
view.doc = id;
- view.first_line = 0;
+ view.offset = Position::default();
let (view, doc) = current!(self);
@@ -194,7 +194,7 @@ impl Editor {
.primary()
.cursor(doc.text().slice(..));
let line = doc.text().char_to_line(pos);
- view.first_line = line.saturating_sub(view.area.height as usize / 2);
+ view.offset.row = line.saturating_sub(view.area.height as usize / 2);
return;
}