aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src/view.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-02-19 08:46:43 +0000
committerBlaž Hrastnik2021-02-19 08:46:43 +0000
commit7877647cf0812380623b0087fbd7bea0ee9fae20 (patch)
treea386d8b5534310763dbab12b9e21ac893b431f94 /helix-view/src/view.rs
parent1e1dae1c11bf00b56213995679647ff30b664a17 (diff)
Allow closing individual views.
Diffstat (limited to 'helix-view/src/view.rs')
-rw-r--r--helix-view/src/view.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/helix-view/src/view.rs b/helix-view/src/view.rs
index 1623dfc4..e02436b3 100644
--- a/helix-view/src/view.rs
+++ b/helix-view/src/view.rs
@@ -8,6 +8,7 @@ use helix_core::{
indent::TAB_WIDTH,
Position, RopeSlice,
};
+use slotmap::DefaultKey as Key;
use tui::layout::Rect;
pub const PADDING: usize = 5;
@@ -15,6 +16,7 @@ pub const PADDING: usize = 5;
// TODO: view should be View { doc: Document(state, history,..) }
// since we can have multiple views into the same file
pub struct View {
+ pub id: Key,
pub doc: Document,
pub first_line: usize,
pub area: Rect,
@@ -24,6 +26,7 @@ pub struct View {
impl View {
pub fn new(doc: Document) -> Result<Self, Error> {
let view = Self {
+ id: Key::default(),
doc,
first_line: 0,
area: Rect::default(), // will get calculated upon inserting into tree