From aecd5ac8e2cb001b1384429eb085e9cef060c912 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Mon, 24 Feb 2020 22:31:26 -0500 Subject: [PATCH] Update termenv and remove nil pointer workaround --- examples/go.mod | 4 ++-- examples/go.sum | 8 ++++---- input/input.go | 3 +-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/examples/go.mod b/examples/go.mod index c882b7e..09b2a90 100644 --- a/examples/go.mod +++ b/examples/go.mod @@ -7,6 +7,6 @@ replace github.com/charmbracelet/teaparty => ../ require ( github.com/charmbracelet/tea v0.0.0-20200220032354-23432f30dd46 github.com/charmbracelet/teaparty v0.0.0-20200212224515-b4d35fd52906 - github.com/muesli/termenv v0.4.1-0.20200131124310-936567584c3e - golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c // indirect + github.com/muesli/termenv v0.4.1-0.20200225030536-aeb2025df636 + golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae // indirect ) diff --git a/examples/go.sum b/examples/go.sum index 2ece0d7..f762d23 100644 --- a/examples/go.sum +++ b/examples/go.sum @@ -8,12 +8,12 @@ github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHX github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/muesli/termenv v0.4.1-0.20200131124310-936567584c3e h1:6exaizu60WAeTP998SgBox6eaSs6rT36fR/0ebsrnOQ= github.com/muesli/termenv v0.4.1-0.20200131124310-936567584c3e/go.mod h1:O1/I6sw+6KcrgAmcs6uiUVr7Lui+DNVbHTzt9Lm/PlI= +github.com/muesli/termenv v0.4.1-0.20200225030536-aeb2025df636 h1:E8Ak48QMa0KO1r/IaPrpUxD+mEcOXB+4Q1ySBx04P6k= +github.com/muesli/termenv v0.4.1-0.20200225030536-aeb2025df636/go.mod h1:O1/I6sw+6KcrgAmcs6uiUVr7Lui+DNVbHTzt9Lm/PlI= github.com/pkg/term v0.0.0-20190109203006-aa71e9d9e942 h1:A7GG7zcGjl3jqAqGPmcNjd/D9hzL95SuoOQAaFNdLU0= github.com/pkg/term v0.0.0-20190109203006-aa71e9d9e942/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200120151820-655fe14d7479 h1:LhLiKguPgZL+Tglay4GhVtfF0kb8cvOJ0dHTCBO8YNI= golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4 h1:sfkvUWPNGwSV+8/fNqctR5lS2AqCSqYwXdrjCxp/dXo= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c h1:jceGD5YNJGgGMkJz79agzOln1K9TaZUjv5ird16qniQ= -golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/input/input.go b/input/input.go index 649d899..49c69ac 100644 --- a/input/input.go +++ b/input/input.go @@ -183,13 +183,12 @@ func placeholderView(m Model) string { func cursorView(s string, m Model) string { if m.blink { return s - } else if m.CursorColor != "" { + } else { return termenv.String(s). Foreground(m.colorProfile.Color(m.CursorColor)). Reverse(). String() } - return termenv.String(s).Reverse().String() } // Subscription