func reloadShowAddr(win *acme.Win, off int) error { if err := win.Ctl("get"); err != nil { return err } if err := win.Addr("#%d", off); err != nil { return err } return win.Ctl("dot=addr\nshow") }
func writeBody(win *acme.Win, ffile string) error { if err := win.Ctl("nomark"); err != nil { fmt.Fprintf(os.Stderr, "failed to set nomark: %s", err) } defer func() { if err := win.Ctl("mark"); err != nil { fmt.Fprintf(os.Stderr, "failed to set mark: %s", err) } }() tf, err := os.Open(ffile) if err != nil { return err } defer tf.Close() if err := win.Addr("0,$"); err != nil { return err } _, err = io.Copy(dataWriter{win}, tf) return err }
func showAddr(win *acme.Win, q0, q1 int) error { if err := win.Addr("#%d,#%d", q0, q1); err != nil { return err } return win.Ctl("dot=addr\nshow\n") }