:windowing commands
:module
:help.m

# youngdrows windowing commands
alias channame {
	if ([$[1]0]==[#]) {
		return $0
	} 
	{
		return #$0
	}
        ^restub channame window.m
}
eval addhelp wj&wj $(c4)[$(c3)channel$(c4)]&joins the specified channel in a new window.
alias wj {
	if ([$0]) {
                ^window new double on hide_others
		^window bind $channame($0)
		^window split $top
		join $channame($0)
	}
        {
		xecho -c $fparse(format_usage wj $(c4)[$(c3)channel$(c4)])
	}
        ^restub wj window.m
}
eval addhelp wns&wns $(c4)[$(c3)server$(c4)]&connects to the specified server in a new window.
alias wns {
	if ([$0]) {
		^window new server $0 double on hide_others 
		^window split $top
	}
        {
                xecho -c $fparse(format_usage wns $(c4)[$(c3)server$(c4)])
        }
        ^restub wns window.m
}

alias win1 {
	window swap 1
        ^restub win1 window.m
}
alias win2 {
        window swap 2
        ^restub win2 window.m
}
alias win3 {
        window swap 3
        ^restub win3 window.m
}
alias win4 {
        window swap 4
        ^restub win4 window.m
}
alias win5 {
        window swap 5
        ^restub win5 window.m
}
alias win6 {
        window swap 6
        ^restub win6 window.m
}
alias win7 {
        window swap 7
        ^restub win7 window.m
}
alias win8 {
        window swap 8
        ^restub win8 window.m
}
alias win9 {
        window swap 9
        ^restub win9 window.m
}
eval addhelp wk&wk&kills the active window. bound to ^Wk
alias wk  {
	window kill
        ^restub wk window.m
}
eval addhelp wc&wc&creates a new window. bound to ^Wc
alias wc {
        ^window new double on hide_others
        ^window split $top
	^restub wc window.m
}
eval addhelp wlk&wlk&parts the active channel and kills the active window.
alias wlk {
	part $T
	wk
        ^restub wlk window.m
} 
eval addhelp wn&wn&cycles to next window. bound to ^Wn
alias wn {
	window next
        ^restub wn window.m
}
eval addhelp wp&wp&cycles to previous window. bound to ^Wp
alias wp {
	window previous
        ^restub wp window.m
}
