diff options
author | Blaž Hrastnik | 2021-08-19 03:52:07 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-08-19 03:52:07 +0000 |
commit | 9776553ad057c12ccee8c0d54d419b159977f34e (patch) | |
tree | 05823129fb443d368cc7d9a09b81f4180545df0d /helix-view/src/editor.rs | |
parent | 115754c5ee5e105ca5b1943abe9b2a1b2299c2bc (diff) |
Refactor view.first_line/first_col into view.offset (Position)
Diffstat (limited to 'helix-view/src/editor.rs')
-rw-r--r-- | helix-view/src/editor.rs | 4 |
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; } |