added sort shortcut for [%]holdings on portfolio

pull/73/head
Vuong 4 years ago
parent f32f46e7e2
commit 3083dee2bd

@ -377,6 +377,7 @@ Key|Action
<kbd>t</kbd>|Sort table by *[t]otal supply* <kbd>t</kbd>|Sort table by *[t]otal supply*
<kbd>u</kbd>|Sort table by *last [u]pdated* <kbd>u</kbd>|Sort table by *last [u]pdated*
<kbd>v</kbd>|Sort table by *24 hour [v]olume* <kbd>v</kbd>|Sort table by *24 hour [v]olume*
<kbd>%</kbd>|Sort table by *[%]holdings*
<kbd>q</kbd>|Quit view <kbd>q</kbd>|Quit view
<kbd>$</kbd>|Go to last page (vim inspired) <kbd>$</kbd>|Go to last page (vim inspired)
<kbd>?</kbd>|Show help| <kbd>?</kbd>|Show help|

@ -295,6 +295,8 @@ func (ct *Cointop) Keybindings(g *gocui.Gui) error {
fn = ct.Sortfn("balance", true) fn = ct.Sortfn("balance", true)
case "sort_column_holdings": case "sort_column_holdings":
fn = ct.Sortfn("holdings", true) fn = ct.Sortfn("holdings", true)
case "sort_column_percentholdings":
fn = ct.Sortfn("percentholdings", true)
case "last_page": case "last_page":
fn = ct.Keyfn(ct.LastPage) fn = ct.Keyfn(ct.LastPage)
case "open_search": case "open_search":

@ -67,6 +67,7 @@ func DefaultShortcuts() map[string]string {
"v": "sort_column_24h_volume", "v": "sort_column_24h_volume",
"q": "quit_view", "q": "quit_view",
"Q": "quit_view", "Q": "quit_view",
"%": "sort_column_percentholdings",
"$": "last_page", "$": "last_page",
"?": "help", "?": "help",
"/": "open_search", "/": "open_search",

@ -30,21 +30,21 @@ func (ct *Cointop) UpdateTableHeader() {
baseColor := ct.colorscheme.TableHeaderSprintf() baseColor := ct.colorscheme.TableHeaderSprintf()
cm := map[string]*t{ cm := map[string]*t{
"rank": &t{baseColor, "[r]ank", 0, 1, " "}, "rank": {baseColor, "[r]ank", 0, 1, " "},
"name": &t{baseColor, "[n]ame", 0, 11, " "}, "name": {baseColor, "[n]ame", 0, 11, " "},
"symbol": &t{baseColor, "[s]ymbol", 4, 0, " "}, "symbol": {baseColor, "[s]ymbol", 4, 0, " "},
"price": &t{baseColor, "[p]rice", 2, 0, " "}, "price": {baseColor, "[p]rice", 2, 0, " "},
"holdings": &t{baseColor, "[h]oldings", 5, 0, " "}, "holdings": {baseColor, "[h]oldings", 5, 0, " "},
"balance": &t{baseColor, "[b]alance", 5, 0, " "}, "balance": {baseColor, "[b]alance", 5, 0, " "},
"marketcap": &t{baseColor, "[m]arket cap", 5, 0, " "}, "marketcap": {baseColor, "[m]arket cap", 5, 0, " "},
"24hvolume": &t{baseColor, "24H [v]olume", 3, 0, " "}, "24hvolume": {baseColor, "24H [v]olume", 3, 0, " "},
"1hchange": &t{baseColor, "[1]H%", 5, 0, " "}, "1hchange": {baseColor, "[1]H%", 5, 0, " "},
"24hchange": &t{baseColor, "[2]4H%", 3, 0, " "}, "24hchange": {baseColor, "[2]4H%", 3, 0, " "},
"7dchange": &t{baseColor, "[7]D%", 4, 0, " "}, "7dchange": {baseColor, "[7]D%", 4, 0, " "},
"totalsupply": &t{baseColor, "[t]otal supply", 7, 0, " "}, "totalsupply": {baseColor, "[t]otal supply", 7, 0, " "},
"availablesupply": &t{baseColor, "[a]vailable supply", 0, 0, " "}, "availablesupply": {baseColor, "[a]vailable supply", 0, 0, " "},
"percentholdings": &t{baseColor, "%holdings", 2, 0, " "}, "percentholdings": {baseColor, "[%]holdings", 2, 0, " "},
"lastupdated": &t{baseColor, "last [u]pdated", 3, 0, " "}, "lastupdated": {baseColor, "last [u]pdated", 3, 0, " "},
} }
for k := range cm { for k := range cm {

Loading…
Cancel
Save