Fixed the Go("-") behaviour when no history is defined making it go to the root.
This commit is contained in:
parent
84419940e3
commit
61cc2d1df1
1 changed files with 7 additions and 3 deletions
|
@ -178,10 +178,14 @@ func (c *Context) Go(pth Path, args ...any) {
|
|||
var back bool
|
||||
if pth == "-" {
|
||||
ln := len(c.pathHistory)
|
||||
if ln <= 1 {
|
||||
pth = "/"
|
||||
} else {
|
||||
pth = c.pathHistory[ln-2]
|
||||
c.pathHistory = c.pathHistory[:ln-1]
|
||||
back = true
|
||||
}
|
||||
}
|
||||
// Getting the screen and changing to
|
||||
// then executing its widget.
|
||||
if !pth.IsAbs() {
|
||||
|
|
Loading…
Reference in a new issue