@@ -39,6 +39,7 @@ func (i item) Description() string { return "" }
3939
4040type fieldItemDelegate struct {
4141 selected map [string ]bool
42+ styles list.DefaultItemStyles
4243}
4344
4445func (d fieldItemDelegate ) Height () int { return 1 }
@@ -61,10 +62,10 @@ func (d fieldItemDelegate) Render(w io.Writer, m list.Model, index int, listItem
6162
6263 line := fmt .Sprintf ("%s %s" , checkbox , name )
6364 if index == m .Index () {
64- fmt .Fprint (w , m . Styles .SelectedTitle .Render (line ))
65+ fmt .Fprint (w , d . styles .SelectedTitle .Render (line ))
6566 return
6667 }
67- fmt .Fprint (w , m . Styles .NormalTitle .Render (line ))
68+ fmt .Fprint (w , d . styles .NormalTitle .Render (line ))
6869}
6970
7071type formatItem struct {
@@ -577,9 +578,9 @@ func (m Model) View() string {
577578
578579func (m * Model ) initQueryTypeList () {
579580 items := []list.Item {
580- queryTypeItem {ty : "Match All" , desc : "Return all documents" , field : "*" },
581- queryTypeItem {ty : "Lucene Query" , desc : "Query string like in Kibana" , field : "query_placeholder" },
582- queryTypeItem {ty : "Raw JSON Query" , desc : "Raw Elasticsearch query DSL" , field : "" },
581+ queryTypeItem {queryType : "Match All" , desc : "Return all documents" , field : "*" },
582+ queryTypeItem {queryType : "Lucene Query" , desc : "Query string like in Kibana" , field : "query_placeholder" },
583+ queryTypeItem {queryType : "Raw JSON Query" , desc : "Raw Elasticsearch query DSL" , field : "" },
583584 }
584585
585586 m .list = list .New (items , list .NewDefaultDelegate (), m .width , m .height - 6 )
@@ -679,15 +680,15 @@ func (m *Model) initFieldsList(fields []string) {
679680 }
680681
681682 m .selectedFields = make (map [string ]bool )
682- m .list = list .New (items , fieldItemDelegate {selected : m .selectedFields }, m .width , m .height - 6 )
683+ m .list = list .New (items , fieldItemDelegate {selected : m .selectedFields , styles : list . NewDefaultItemStyles () }, m .width , m .height - 6 )
683684 m .list .Title = title
684685 m .list .SetShowStatusBar (false )
685686 m .list .SetFilteringEnabled (true )
686687}
687688
688689func (m * Model ) initFieldsLoading () {
689690 m .selectedFields = make (map [string ]bool )
690- m .list = list .New ([]list.Item {}, fieldItemDelegate {selected : m .selectedFields }, m .width , m .height - 6 )
691+ m .list = list .New ([]list.Item {}, fieldItemDelegate {selected : m .selectedFields , styles : list . NewDefaultItemStyles () }, m .width , m .height - 6 )
691692 m .list .Title = "Loading fields..."
692693 m .list .SetShowStatusBar (false )
693694 m .list .SetFilteringEnabled (false )
0 commit comments