@@ -66,7 +66,7 @@ impl Editor {
69− pub fn switch(&mut self, id: DocumentId, action: Action) -> Result<DocumentId, Error> {
69+ pub fn switch(&mut self, id: DocumentId, action: Action) {
70 use crate::tree::Layout;
70 use crate::tree::Layout;
71 use helix_core::Selection;
71 use helix_core::Selection;
72 match action {
72 match action {
@@ -87,17 +87,17 @@ impl Editor {
87 let doc = &mut self.documents[id];
87 let doc = &mut self.documents[id];
88 doc.selections.insert(view_id, Selection::point(0));
88 doc.selections.insert(view_id, Selection::point(0));
90− return Ok(id);
90+ return;
92 Action::HorizontalSplit => {
92 Action::HorizontalSplit => {
93− let view = View::new(id)?;
93+ let view = View::new(id);
94 let view_id = self.tree.split(view, Layout::Horizontal);
94 let view_id = self.tree.split(view, Layout::Horizontal);
95 // initialize selection for view
95 // initialize selection for view
96 let doc = &mut self.documents[id];
96 let doc = &mut self.documents[id];
97 doc.selections.insert(view_id, Selection::point(0));
97 doc.selections.insert(view_id, Selection::point(0));
99 Action::VerticalSplit => {
99 Action::VerticalSplit => {
100− let view = View::new(id)?;
100+ let view = View::new(id);
101 let view_id = self.tree.split(view, Layout::Vertical);
101 let view_id = self.tree.split(view, Layout::Vertical);
102 // initialize selection for view
102 // initialize selection for view
103 let doc = &mut self.documents[id];
103 let doc = &mut self.documents[id];
@@ -106,16 +106,15 @@ impl Editor {
108 self._refresh();
108 self._refresh();
113− pub fn new_file(&mut self, action: Action) -> Result<DocumentId, Error> {
111+ pub fn new_file(&mut self, action: Action) -> DocumentId {
114 use helix_core::Rope;
112 use helix_core::Rope;
115 let doc = Document::new(Rope::from("\n"));
113 let doc = Document::new(Rope::from("\n"));
116 let id = self.documents.insert(doc);
114 let id = self.documents.insert(doc);
117 self.documents[id].id = id;
115 self.documents[id].id = id;
118− self.switch(id, action)
116+ self.switch(id, action);
121 pub fn open(&mut self, path: PathBuf, action: Action) -> Result<DocumentId, Error> {
120 pub fn open(&mut self, path: PathBuf, action: Action) -> Result<DocumentId, Error> {
@@ -159,7 +158,8 @@ impl Editor {
162− self.switch(id, action)
161+ self.switch(id, action);
165 pub fn close(&mut self, id: ViewId) {
165 pub fn close(&mut self, id: ViewId) {