@@ -1157,7 +1157,8 @@ impl Component for EditorView {
1157 // clear status
1157 // clear status
1158 cx.editor.status_msg = None;
1158 cx.editor.status_msg = None;
1160− let doc = doc!(cx.editor);
1160+ let (view, doc) = current!(cx.editor);
1161+ let focus = view.id;
1161 let mode = doc.mode();
1162 let mode = doc.mode();
1163 if let Some(on_next_key) = self.on_next_key.take() {
1164 if let Some(on_next_key) = self.on_next_key.take() {
@@ -1221,7 +1222,9 @@ impl Component for EditorView {
1221 return EventResult::Ignored(None);
1222 return EventResult::Ignored(None);
1223 let config = cx.editor.config();
1224 let config = cx.editor.config();
1224− let (view, doc) = current!(cx.editor);
1225+ let view = cx.editor.tree.get_mut(focus);
1226+ let doc = cx.editor.documents.get_mut(&view.doc).unwrap();
1225 view.ensure_cursor_in_view(doc, config.scrolloff);
1228 view.ensure_cursor_in_view(doc, config.scrolloff);
1227 // Store a history state if not in insert mode. This also takes care of
1230 // Store a history state if not in insert mode. This also takes care of