~laumann/acme-git

f0a79821ee7b9950309c8c36b28862fa01ca7c0a — Thomas Bracht Laumann Jespersen 1 year, 11 months ago 227a1af
Properly set GIT_EDITOR, replace wipe() with win.Clear()
1 files changed, 6 insertions(+), 9 deletions(-)

M Git.go
M Git.go => Git.go +6 -9
@@ 10,13 10,8 @@ import (

var win *acme.Win

func wipe() {
	win.Addr(",")
	win.Write("data", nil)
}

func gitcmd(arg ...string) {
	wipe()
	win.Clear()
	cmd := exec.Command("git", arg...)
	r, w, err := os.Pipe()
	if err != nil {


@@ 73,10 68,10 @@ func commit() {
	cmd.Stdout = w
	cmd.Stderr = w

	cmd.Env = append(os.Environ(), "GIT_EDITOR=acme-ed.sh")
	cmd.Env = append(os.Environ(), "GIT_EDITOR=Git")
	err = cmd.Start()
	w.Close()
	wipe()
	win.Clear()
	if err != nil {
		r.Close()
		win.Fprintf("data", "(exec: %s)\n", err)


@@ 100,7 95,9 @@ func giteditor() {
		log.Fatal(err)
	}

	cwin.Ctl("name " + os.Args[1])
	if err = cwin.Name(os.Args[1]); err != nil {
		log.Fatal(err)
	}
	cwin.Ctl("get")

	for e := range cwin.EventChan() {