예제 #1
0
func getLine(g *gocui.Gui, v *gocui.View) error {
	var l string
	var err error

	_, cy := v.Cursor()
	if l, err = v.Line(cy); err != nil {
		l = ""
	}

	maxX, maxY := g.Size()
	if v, err := g.SetView("msg", maxX/2-30, maxY/2, maxX/2+30, maxY/2+2); err != nil {
		if err != gocui.ErrorUnkView {
			return err
		}
		fmt.Fprintln(v, l)
		if err := g.SetCurrentView("msg"); err != nil {
			return err
		}
	}

	if v, err := g.View("main"); err != nil {
		if err != gocui.ErrorUnkView {
			return err
		}
		f := proj.GetFile(l)
		if f != nil {
			v.Clear()
			fmt.Fprintf(v, "%s", f.GetBody())
		}
		v.Editable = true
		v.Wrap = true
	}
	return nil
}
예제 #2
0
func renderHelp(v *gocui.View, refresh bool) {
	v.Wrap = true
	v.Autoscroll = false
	Help.draw(v, refresh)
}
예제 #3
0
func renderStack(v *gocui.View, refresh bool) {
	v.Wrap = true
	v.Autoscroll = false
	Stack.draw(v, refresh)
}
예제 #4
0
func renderVm(v *gocui.View, refresh bool) {
	v.Wrap = true
	v.Autoscroll = false
	VM.draw(v, refresh)
}
예제 #5
0
func renderSource(v *gocui.View, refresh bool) {
	v.Wrap = true
	v.Autoscroll = false
	Source.draw(v, refresh)
}
예제 #6
0
func renderOutput(v *gocui.View, refresh bool) {
	v.Wrap = true
	Output.draw(v, refresh)
}
예제 #7
0
func renderLog(v *gocui.View, refresh bool) {
	v.Wrap = true
	Log.draw(v, refresh)
}