1
0
mirror of https://github.com/mrusme/neonmodem.git synced 2024-06-16 06:25:23 +00:00

Implemented args passthrough for WM Close

This commit is contained in:
マリウス 2023-01-04 21:42:35 -05:00
parent 587bab0859
commit d0574d40e3
No known key found for this signature in database
GPG Key ID: 272ED814BF63261F

View File

@ -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()