From 275a42440af0837f7278c5d894b0f601562dddb0 Mon Sep 17 00:00:00 2001 From: Sameer Rahmani Date: Fri, 25 Nov 2022 15:30:24 +0000 Subject: [PATCH] Fix the selection style --- filter.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/filter.go b/filter.go index 4ba779b..3a3e816 100644 --- a/filter.go +++ b/filter.go @@ -41,6 +41,11 @@ var highlight, selectionArrow, normalArrow tcell.Style +type Scene struct { + ID int + RenderFn func(*State, Items) +} + type State struct { Current int InSelectionMode bool @@ -69,7 +74,7 @@ func drawText(s tcell.Screen, x1, y1, x2, y2 int, style tcell.Style, text string } // Main render function that gets called during the event loop. -func Render(s State, inputs Items) { +func Render(s *State, inputs Items) { y := 2 status := fmt.Sprintf("Navigation: [UP or C-p] [Down or C-n] | Select: SPACE | Cancel: [q ESC] | Done: [Enter] | Line: %d", s.Current+1) drawText(*s.Screen, 0, 0, xmax-1, 1, helpStyle, status) @@ -231,6 +236,7 @@ func main() { } state.InSelectionMode = !state.InSelectionMode + } else if ev.Rune() == '?' { } } }