diff --git a/README.md b/README.md index 2f6ba7f..e76475a 100644 --- a/README.md +++ b/README.md @@ -155,6 +155,7 @@ Key|Action a|Sort table by *[a]vailable supply* c|Toggle [c]hart for highlighted coin f|Toggle show favorites +F|Toggle show favorites g|Go to first line of page (vim inspired) G|Go to last line of page (vim inspired) h|Go to previous page (vim inspired) @@ -225,6 +226,7 @@ You can then configure the actions you want for each key: enter = "toggle_row_chart" esc = "quit" f = "toggle_show_favorites" + F = "toggle_show_favorites" F1 = "help" g = "move_to_page_first_row" h = "previous_page" diff --git a/cointop/chart.go b/cointop/chart.go index e83668c..afb412e 100644 --- a/cointop/chart.go +++ b/cointop/chart.go @@ -68,7 +68,8 @@ func (ct *Cointop) chartPoints(maxX int, coin string) error { return nil } for i := range graphData.MarketCapByAvailableSupply { - data = append(data, graphData.MarketCapByAvailableSupply[i][1]/1E9) + price := graphData.MarketCapByAvailableSupply[i][1] + data = append(data, price/1E9) } } else { graphData, err := ct.api.GetCoinGraphData(coin, start, end) @@ -76,7 +77,8 @@ func (ct *Cointop) chartPoints(maxX int, coin string) error { return nil } for i := range graphData.PriceUSD { - data = append(data, graphData.PriceUSD[i][1]) + price := graphData.PriceUSD[i][1] + data = append(data, price) } } diff --git a/cointop/cointop.go b/cointop/cointop.go index 561be0b..9104afa 100644 --- a/cointop/cointop.go +++ b/cointop/cointop.go @@ -48,6 +48,7 @@ type Cointop struct { config config // toml config searchfield *gocui.View searchfieldviewname string + searchfieldvisible bool favorites map[string]bool filterByFavorites bool savemux sync.Mutex @@ -128,7 +129,7 @@ func Run() { } func (ct *Cointop) quit() error { - if ct.helpvisible { + if ct.helpvisible || ct.searchfieldvisible { return nil } diff --git a/cointop/search.go b/cointop/search.go index 527aba5..081149e 100644 --- a/cointop/search.go +++ b/cointop/search.go @@ -8,11 +8,13 @@ import ( ) func (ct *Cointop) openSearch() error { + ct.searchfieldvisible = true ct.setActiveView(ct.searchfieldviewname) return nil } func (ct *Cointop) cancelSearch() error { + ct.searchfieldvisible = false ct.setActiveView(ct.tableviewname) return nil } diff --git a/cointop/shortcuts.go b/cointop/shortcuts.go index 444fa26..b597858 100644 --- a/cointop/shortcuts.go +++ b/cointop/shortcuts.go @@ -34,6 +34,7 @@ func defaultShortcuts() map[string]string { "a": "sort_column_available_supply", "c": "toggle_row_chart", "f": "toggle_show_favorites", + "F": "toggle_show_favorites", "g": "move_to_page_first_row", "G": "move_to_page_last_row", "h": "previous_page", diff --git a/pkg/termui/linechart.go b/pkg/termui/linechart.go index f7eea28..cc63f0d 100644 --- a/pkg/termui/linechart.go +++ b/pkg/termui/linechart.go @@ -183,7 +183,8 @@ func (lc *LineChart) calcLabelX() { func shortenFloatVal(x float64) string { s := fmt.Sprintf("%.2f", x) if len(s)-3 > 3 { - s = fmt.Sprintf("%.2e", x) + // don't shorten + //s = fmt.Sprintf("%.2e", x) } if x < 0 {