@@ -4142,12 +4142,16 @@ fn split(cx: &mut Context, action: Action) {
41424142 let (view, doc) = current!(cx.editor);
41434143 let id = doc.id();
41444144 let selection = doc.selection(view.id).clone();
4145+ let offset = view.offset;
41454146
41464147 cx.editor.switch(id, action);
41474148
41484149 // match the selection in the previous view
41494150 let (view, doc) = current!(cx.editor);
41504151 doc.set_selection(view.id, selection);
4152+ // match the view scroll offset (switch doesn't handle this fully
4153+ // since the selection is only matched after the split)
4154+ view.offset = offset;
41514155}
41524156
41534157fn hsplit(cx: &mut Context) {