~mkhl/xplor

edfed8b914bceb777a8bab52e68b25cf7c603e75 — Martin Kühl 10 months ago 2ae3bea
Add Cd command
2 files changed, 15 insertions(+), 2 deletions(-)

M README.md
M xplor.go
M README.md => README.md +3 -1
@@ 28,7 28,9 @@ Button 2 to open those windows for the current xplor directory,

`All` toggles whether xplor displays hidden entries.

`Up` opens parent of the current directory in the same window.
`Up` opens parent of the current directory in the current window.

`Cd` opens the chorded directory in the current window.

[win]: https://9fans.github.io/plan9port/man/man1/acme.html


M xplor.go => xplor.go +12 -1
@@ 23,7 23,7 @@ import (

const (
	this     = "xplor"
	tag      = "Get All Up Win Xplor "
	tag      = "Get All Up Cd Win Xplor "
	tab      = "\t"
	flagFile = " "
	flagLess = "▸"


@@ 216,6 216,11 @@ func goUp() error {
	return redraw()
}

func cd(dir string) error {
	root = dir
	return redraw()
}

// Line Interaction

func look(addr string) error {


@@ 367,6 372,12 @@ func handle(e *acme.Event) error {
			return toggleAll()
		case "Up":
			return goUp()
		case "Cd":
			dir, err := loc(e)
			if err != nil {
				return err
			}
			return cd(dir)
		case "Win":
			exe := filepath.Join(PLAN9, "bin", "win")
			dir, err := loc(e)