aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src/editor.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/editor.rs
parent8328fe926d34d12031cb50db47a9dd39ed681a84 (diff)
Derive a separate ViewId type.
Diffstat (limited to 'helix-view/src/editor.rs')
-rw-r--r--helix-view/src/editor.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs
index 802ca3e1..0407f344 100644
--- a/helix-view/src/editor.rs
+++ b/helix-view/src/editor.rs
@@ -1,9 +1,9 @@
-use crate::{theme::Theme, tree::Tree, Document, DocumentId, View};
+use crate::{theme::Theme, tree::Tree, Document, DocumentId, View, ViewId};
use tui::layout::Rect;
use std::path::PathBuf;
-use slotmap::{DefaultKey as Key, SlotMap};
+use slotmap::SlotMap;
use anyhow::Error;
@@ -90,7 +90,7 @@ impl Editor {
Ok(id)
}
- pub fn close(&mut self, id: Key) {
+ pub fn close(&mut self, id: ViewId) {
let view = self.tree.get(self.tree.focus);
// get around borrowck issues
let language_servers = &mut self.language_servers;
@@ -133,7 +133,7 @@ impl Editor {
self.tree.get_mut(self.tree.focus)
}
- pub fn ensure_cursor_in_view(&mut self, id: Key) {
+ pub fn ensure_cursor_in_view(&mut self, id: ViewId) {
let view = self.tree.get_mut(id);
let doc = &self.documents[view.doc];
view.ensure_cursor_in_view(doc)