@@ -320,6 +320,7 @@ impl Command {
320320 hsplit, "Horizontal bottom split",
321321 vsplit, "Vertical right split",
322322 wclose, "Close window",
323+ wonly, "Current window only",
323324 select_register, "Select register",
324325 align_view_middle, "Align view middle",
325326 align_view_top, "Align view top",
@@ -4723,6 +4724,20 @@ fn wclose(cx: &mut Context) {
47234724 cx.editor.close(view_id, /* close_buffer */ false);
47244725}
47254726
4727+fn wonly(cx: &mut Context) {
4728+ let views = cx
4729+ .editor
4730+ .tree
4731+ .views()
4732+ .map(|(v, focus)| (v.id, focus))
4733+ .collect::<Vec<_>>();
4734+ for (view_id, focus) in views {
4735+ if !focus {
4736+ cx.editor.close(view_id, /* close_buffer */ false);
4737+ }
4738+ }
4739+}
4740+
47264741fn select_register(cx: &mut Context) {
47274742 cx.on_next_key(move |cx, event| {
47284743 if let Some(ch) = event.char() {