1
0
mirror of https://github.com/makew0rld/amfora.git synced 2024-12-04 14:46:29 -05:00
amfora/display/history.go
2021-06-25 19:03:41 -04:00

26 lines
518 B
Go

package display
// applyHist is a history.go internal function, to load a URL in the history.
func applyHist(t *tab) {
t.handleURL(t.history.urls[t.history.pos], 0) // Load that position in history
t.applyAll()
}
func (t *tab) histForward() {
if t.history.pos >= len(t.history.urls)-1 {
// Already on the most recent URL in the history
return
}
t.history.pos++
go applyHist(t)
}
func (t *tab) histBack() {
if t.history.pos <= 0 {
// First tab in history
return
}
t.history.pos--
go applyHist(t)
}