From 518c35453a427a5557f0f368592ed941fe2c8769 Mon Sep 17 00:00:00 2001 From: makeworld Date: Sat, 4 Jul 2020 11:32:11 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Rename=20reformat=20func?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NOTES.md | 4 ++-- display/display.go | 4 ++-- display/private.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) 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)