fix: fixed the wrong "-" path interpretation in the Go method.
This commit is contained in:
parent
ab1437a15b
commit
638b1c1f78
2 changed files with 6 additions and 4 deletions
|
@ -170,10 +170,7 @@ func (compo *CommandCompo) Serve(c *Context) {
|
||||||
c.WithUpdate(u).Run(cmd.Action)
|
c.WithUpdate(u).Run(cmd.Action)
|
||||||
if cmd.Widget != nil {
|
if cmd.Widget != nil {
|
||||||
cmdUpdates.Close()
|
cmdUpdates.Close()
|
||||||
cmdUpdates, err = c.WithUpdate(u).RunWidget(cmd.Widget)
|
cmdUpdates, _ = c.WithUpdate(u).RunWidget(cmd.Widget)
|
||||||
if err != nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
|
@ -232,6 +232,11 @@ func (c *Context) Go(pth Path, args ...any) error {
|
||||||
}
|
}
|
||||||
var back bool
|
var back bool
|
||||||
if pth == "-" {
|
if pth == "-" {
|
||||||
|
if len(c.pathHistory) < 2 {
|
||||||
|
return c.Go("")
|
||||||
|
}
|
||||||
|
pth = c.pathHistory[len(c.pathHistory)-2]
|
||||||
|
c.pathHistory = c.pathHistory[:len(c.pathHistory)-1]
|
||||||
}
|
}
|
||||||
// Getting the screen and changing to
|
// Getting the screen and changing to
|
||||||
// then executing its widget.
|
// then executing its widget.
|
||||||
|
|
Loading…
Reference in a new issue