mirror of
https://github.com/mrusme/neonmodem.git
synced 2024-12-04 14:46:37 -05:00
Implemented args passthrough for WM Close
This commit is contained in:
parent
587bab0859
commit
d0574d40e3
@ -62,12 +62,12 @@ func (wm *WM) CloseFocused() (bool, []tea.Cmd) {
|
||||
return wm.Close(wm.Focused())
|
||||
}
|
||||
|
||||
func (wm *WM) Close(id string) (bool, []tea.Cmd) {
|
||||
func (wm *WM) Close(id string, args ...cmd.Arg) (bool, []tea.Cmd) {
|
||||
var tcmds []tea.Cmd
|
||||
for i := len(wm.stack) - 1; i >= 0; i-- {
|
||||
if wm.stack[i].ID == id {
|
||||
wm.stack = append(wm.stack[:i], wm.stack[i+1:]...)
|
||||
tcmds = append(tcmds, cmd.New(cmd.WinClose, id).Tea())
|
||||
tcmds = append(tcmds, cmd.New(cmd.WinClose, id, args...).Tea())
|
||||
wm.ctx.Loading = false
|
||||
|
||||
nrOpen := wm.GetNumberOpen()
|
||||
|
Loading…
Reference in New Issue
Block a user