示例#1
0
文件: view.go 项目: tv42/godit
func new_view(ctx view_context, buf *buffer) *view {
	v := new(view)
	v.ctx = ctx
	v.uibuf = tulib.NewBuffer(1, 1)
	v.attach(buf)
	v.ac_decide = default_ac_decide
	v.highlight_ranges = make([]byte_range, 0, 10)
	v.tags = make([]view_tag, 0, 10)
	return v
}
示例#2
0
文件: view.go 项目: pombredanne/vigo
func newView(ctx viewContext, buf *buffer.Buffer, redraw chan struct{}) *view {
	v := new(view)
	v.ctx = ctx
	v.uiBuf = tulib.NewBuffer(1, 1)
	v.attach(buf)
	v.highlightRanges = make([]byteRange, 0, 10)
	v.tags = make([]viewTag, 0, 10)
	v.redraw = redraw
	return v
}
示例#3
0
文件: view.go 项目: kisielk/vigo
func NewView(ctx Context, buf *buffer.Buffer, redraw chan struct{}) *View {
	v := &View{
		ctx:             ctx,
		uiBuf:           tulib.NewBuffer(1, 1),
		highlightRanges: make([]byteRange, 0, 10),
		tags:            make([]Tag, 0, 10),
		redraw:          redraw,
		showHighlights:  true,
	}
	v.Attach(buf)
	return v
}