From ec0559f2d5119d6a8ec59da3641cd09f2ed68574 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Fri, 17 Apr 2020 20:38:11 +0200 Subject: [PATCH] Simplify code --- input/input.go | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/input/input.go b/input/input.go index 826fbbb..5303258 100644 --- a/input/input.go +++ b/input/input.go @@ -37,10 +37,7 @@ type Model struct { // Focused returns the focus state on the model func (m Model) Focused() bool { - if m.focus { - return true - } - return false + return m.focus } // Focus sets the focus state on the model @@ -206,12 +203,12 @@ func placeholderView(m Model) string { func cursorView(s string, m Model) string { if m.blink { return s - } else { - return termenv.String(s). - Foreground(color(m.CursorColor)). - Reverse(). - String() } + + return termenv.String(s). + Foreground(color(m.CursorColor)). + Reverse(). + String() } // Subscription