@@ -354,7 +354,7 @@ impl Application {
354354 fn render(&mut self) {
355355 let viewport = Rect::new(OFFSET, 0, self.terminal.size.0, self.terminal.size.1 - 2); // - 2 for statusline and prompt
356356
357− if let Some(view) = &mut self.editor.view {
357+ if let Some(view) = self.editor.view_mut() {
358358 self.terminal.render_view(view, viewport);
359359 if let Some(prompt) = &self.prompt {
360360 if prompt.should_close {
@@ -368,11 +368,8 @@ impl Application {
368368 self.terminal.draw();
369369
370370 // TODO: drop unwrap
371− self.terminal.render_cursor(
372− self.editor.view.as_ref().unwrap(),
373− self.prompt.as_ref(),
374− viewport,
375− );
371+ self.terminal
372+ .render_cursor(self.editor.view().unwrap(), self.prompt.as_ref(), viewport);
376373 }
377374
378375 pub async fn event_loop(&mut self) {
@@ -392,7 +389,7 @@ impl Application {
392389 self.terminal.resize(width, height);
393390
394391 // TODO: simplistic ensure cursor in view for now
395− if let Some(view) = &mut self.editor.view {
392+ if let Some(view) = self.editor.view_mut() {
396393 view.size = self.terminal.size;
397394 view.ensure_cursor_in_view()
398395 };
@@ -408,7 +405,7 @@ impl Application {
408405 .handle_input(event, &mut self.editor);
409406
410407 self.render();
411− } else if let Some(view) = &mut self.editor.view {
408+ } else if let Some(view) = self.editor.view_mut() {
412409 let keys = vec![event];
413410 // TODO: sequences (`gg`)
414411 // TODO: handle count other than 1