diff --git a/NOTES.md b/NOTES.md index 0a221fc..73b998b 100644 --- a/NOTES.md +++ b/NOTES.md @@ -1,8 +1,8 @@ # Notes - Simplify into one struct - - All the maps and stuff could be replaced with a `tab` struct - - And then just one single map of tab number to `tab` + - All the maps and stuff could be replaced with a `Tab` struct + - And then just one single map of tab number to `Tab` - URL for each tab should not be stored as a string - in the current code there's lots of reparsing the URL ## Upstream Bugs diff --git a/display/display.go b/display/display.go index 5a67c22..6f9e6a7 100644 --- a/display/display.go +++ b/display/display.go @@ -89,7 +89,7 @@ var App = cview.NewApplication(). reformatMuts[tab].Lock() // Only one reformat job per tab defer reformatMuts[tab].Unlock() // Use the current tab, but don't affect other tabs if the user switches tabs - reformatAndDisplayPage(tab, tabMap[tab]) + reformatPageAndSetView(tab, tabMap[tab]) }(curTab) }) @@ -517,7 +517,7 @@ func SwitchTab(tab int) { } curTab = tab % NumTabs() - reformatAndDisplayPage(curTab, tabMap[curTab]) + reformatPageAndSetView(curTab, tabMap[curTab]) tabPages.SwitchToPage(strconv.Itoa(curTab)) tabRow.Highlight(strconv.Itoa(curTab)).ScrollToHighlight() diff --git a/display/private.go b/display/private.go index 34d3c0a..7a1480e 100644 --- a/display/private.go +++ b/display/private.go @@ -183,9 +183,9 @@ func reformatPage(p *structs.Page) { p.Width = termW } -// reformatAndDisplayPage is for reformatting a page that is already being displayed. +// reformatPageAndSetView is for reformatting a page that is already being displayed. // setPage should be used when a page is being loaded for the first time. -func reformatAndDisplayPage(tab int, p *structs.Page) { +func reformatPageAndSetView(tab int, p *structs.Page) { saveScroll() reformatPage(p) tabViews[tab].SetText(p.Content)