func (g *govimImpl) ChannelExpr(expr string) (json.RawMessage, error) {
	ch := make(unscheduledCallback)
	err := g.channelExprImpl(ch, expr)
	return g.handleChannelValueAndError(ch, err, channelExprErrMsg, expr)
}
ChannelExpr implements Govim.ChannelExpr
package govim
import (
	"encoding/json"
	"fmt"
	"io"
)
func (g *govimImpl) handleChannelError(ch unscheduledCallback, err error, format string, args ...interface{}) error {
	_, err = g.handleChannelValueAndError(ch, err, format, args)
	return err
}
func (g *govimImpl) handleChannelValueAndError(ch unscheduledCallback, err error, format string, args ...interface{}) (json.RawMessage, error) {
	if err != nil {
		return nil, err
	}
	args = append([]interface{}{}, args...)
	select {
	case <-g.tomb.Dying():
		panic(ErrShuttingDown)
	case resp := <-ch:
		if resp.errString != "" {
			args = append(args, resp.errString)
			return nil, fmt.Errorf(format, args...)
		}
		return resp.val, nil
	}
}
func (g *govimImpl) ChannelRedraw(force bool) error {
	ch := make(unscheduledCallback)
	err := g.channelRedrawImpl(ch, force)
	return g.handleChannelError(ch, err, channelRedrawErrMsg, force)
}
const channelRedrawErrMsg = "failed to redraw (force = %v) in Vim: %v"
func (g *govimImpl) channelRedrawImpl(ch callback, force bool) error {
	<-g.loaded
	var sForce string
	if force {
		sForce = "force"
	}
	return g.DoProto(func() error {
		return g.callVim(ch, "redraw", sForce)
	})
}
func (g *govimImpl) ChannelEx(expr string) error {
	ch := make(unscheduledCallback)
	err := g.channelExImpl(ch, expr)
	return g.handleChannelError(ch, err, channelExErrMsg, expr)
}
const channelExErrMsg = "failed to ex(%v) in Vim: %v"
func (g *govimImpl) channelExImpl(ch callback, expr string) error {
	<-g.loaded
	return g.DoProto(func() error {
		return g.callVim(ch, "ex", expr)
	})
}
func (g *govimImpl) ChannelNormal(expr string) error {
	ch := make(unscheduledCallback)
	err := g.channelNormalImpl(ch, expr)
	return g.handleChannelError(ch, err, channelNormalErrMsg, expr)
}
const channelNormalErrMsg = "failed to normal(%v) in Vim: %v"
func (g *govimImpl) channelNormalImpl(ch callback, expr string) error {
	<-g.loaded
	return g.DoProto(func() error {
		return g.callVim(ch, "normal", expr)
	})
}