@ -320,6 +320,7 @@ impl Command {
hsplit , "Horizontal bottom split" ,
hsplit , "Horizontal bottom split" ,
vsplit , "Vertical right split" ,
vsplit , "Vertical right split" ,
wclose , "Close window" ,
wclose , "Close window" ,
wonly , "Current window only" ,
select_register , "Select register" ,
select_register , "Select register" ,
align_view_middle , "Align view middle" ,
align_view_middle , "Align view middle" ,
align_view_top , "Align view top" ,
align_view_top , "Align view top" ,
@ -4723,6 +4724,20 @@ fn wclose(cx: &mut Context) {
cx . editor . close ( view_id , /* close_buffer */ false ) ;
cx . editor . close ( view_id , /* close_buffer */ false ) ;
}
}
fn wonly ( cx : & mut Context ) {
let views = cx
. editor
. tree
. views ( )
. map ( | ( v , focus ) | ( v . id , focus ) )
. collect ::< Vec < _ > > ( ) ;
for ( view_id , focus ) in views {
if ! focus {
cx . editor . close ( view_id , /* close_buffer */ false ) ;
}
}
}
fn select_register ( cx : & mut Context ) {
fn select_register ( cx : & mut Context ) {
cx . on_next_key ( move | cx , event | {
cx . on_next_key ( move | cx , event | {
if let Some ( ch ) = event . char ( ) {
if let Some ( ch ) = event . char ( ) {