aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src/view.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-03-24 05:03:20 +0000
committerBlaž Hrastnik2021-03-24 05:03:20 +0000
commitb24cdd1295d1129dc730e02da2c6723938220d7e (patch)
tree00413aa7a19bd84a59173921c4184c3e68e05d77 /helix-view/src/view.rs
parent8328fe926d34d12031cb50db47a9dd39ed681a84 (diff)
Derive a separate ViewId type.
Diffstat (limited to 'helix-view/src/view.rs')
-rw-r--r--helix-view/src/view.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/helix-view/src/view.rs b/helix-view/src/view.rs
index 9d3f1412..5f6a0456 100644
--- a/helix-view/src/view.rs
+++ b/helix-view/src/view.rs
@@ -2,18 +2,17 @@ use anyhow::Error;
use std::borrow::Cow;
-use crate::{Document, DocumentId};
+use crate::{Document, DocumentId, ViewId};
use helix_core::{
graphemes::{grapheme_width, RopeGraphemes},
Position, RopeSlice,
};
-use slotmap::DefaultKey as Key;
use tui::layout::Rect;
pub const PADDING: usize = 5;
pub struct View {
- pub id: Key,
+ pub id: ViewId,
pub doc: DocumentId,
pub first_line: usize,
pub area: Rect,
@@ -22,7 +21,7 @@ pub struct View {
impl View {
pub fn new(doc: DocumentId) -> Result<Self, Error> {
let view = Self {
- id: Key::default(),
+ id: ViewId::default(),
doc,
first_line: 0,
area: Rect::default(), // will get calculated upon inserting into tree