mirror of
https://github.com/makeworld-the-better-one/amfora.git
synced 2024-11-22 07:23:05 +03:00
Possibly improve resize logic perf
This commit is contained in:
parent
946b3f5bc0
commit
bc81281c84
@ -82,8 +82,6 @@ func Init(version, commit, builtBy string) {
|
||||
termH = height
|
||||
|
||||
// Make sure the current tab content is reformatted when the terminal size changes
|
||||
go func(t *tab) {
|
||||
reformatMu.Lock() // Only allow one reformat job at a time
|
||||
for i := range tabs {
|
||||
// Overwrite all tabs with a new, differently sized, left margin
|
||||
browser.AddTab(
|
||||
@ -91,14 +89,11 @@ func Init(version, commit, builtBy string) {
|
||||
tabs[i].label(),
|
||||
makeContentLayout(tabs[i].view, leftMargin()),
|
||||
)
|
||||
if tabs[i] == t {
|
||||
if tabs[i] == tabs[curTab] {
|
||||
// Reformat page ASAP, in the middle of loop
|
||||
reformatPageAndSetView(t, t.page)
|
||||
reformatPageAndSetView(tabs[curTab], tabs[curTab].page)
|
||||
}
|
||||
}
|
||||
App.Draw()
|
||||
reformatMu.Unlock()
|
||||
}(tabs[curTab])
|
||||
})
|
||||
|
||||
panels.AddPanel(PanelBrowser, browser, true, true)
|
||||
|
Loading…
Reference in New Issue
Block a user