~ghost08/tcell-term

e5a18986b4e8b96ddedeac2cec0e0da567456d07 — Tim Culverhouse 2 years ago 922b568
terminal: don't require view and screen at New

Reverts a previous commit

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
1 files changed, 2 insertions(+), 14 deletions(-)

M terminal.go
M terminal.go => terminal.go +2 -14
@@ 28,21 28,9 @@ type Terminal struct {
	views.WidgetWatchers
}

func New(screen tcell.Screen, view views.View, opts ...Option) *Terminal {
	var err error
	if screen == nil {
		screen, err = tcell.NewScreen()
		if err != nil {
			panic(err)
		}
	}
	if view == nil {
		view = views.NewViewPort(screen, 0, 0, -1, -1)
	}
func New(opts ...Option) *Terminal {
	t := &Terminal{
		term:   termutil.New(),
		screen: screen,
		view:   view,
		term: termutil.New(),
	}
	t.term.SetWindowManipulator(&windowManipulator{})
	for _, opt := range opts {