mirror of
https://github.com/makew0rld/amfora.git
synced 2024-12-04 14:46:29 -05:00
⚡️ Don't re-set text when there hasn't been changes
This commit is contained in:
parent
a2a56b942a
commit
aa28bc78b2
@ -83,6 +83,10 @@ func reformatPage(p *structs.Page) {
|
|||||||
// reformatPageAndSetView 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.
|
// setPage should be used when a page is being loaded for the first time.
|
||||||
func reformatPageAndSetView(t *tab, p *structs.Page) {
|
func reformatPageAndSetView(t *tab, p *structs.Page) {
|
||||||
|
if p.Width == termW {
|
||||||
|
// No changes to make
|
||||||
|
return
|
||||||
|
}
|
||||||
t.saveScroll()
|
t.saveScroll()
|
||||||
reformatPage(p)
|
reformatPage(p)
|
||||||
t.view.SetText(p.Content)
|
t.view.SetText(p.Content)
|
||||||
|
Loading…
Reference in New Issue
Block a user