2020-06-18 16:54:48 -04:00
|
|
|
package display
|
|
|
|
|
2020-07-07 21:13:45 -04:00
|
|
|
// applyHist is a history.go internal function, to load a URL in the history.
|
|
|
|
func applyHist(t *tab) {
|
2021-06-25 19:03:41 -04:00
|
|
|
t.handleURL(t.history.urls[t.history.pos], 0) // Load that position in history
|
2020-07-07 21:13:45 -04:00
|
|
|
t.applyAll()
|
2020-06-18 16:54:48 -04:00
|
|
|
}
|
|
|
|
|
2021-06-25 19:03:41 -04:00
|
|
|
func (t *tab) histForward() {
|
2020-07-07 21:13:45 -04:00
|
|
|
if t.history.pos >= len(t.history.urls)-1 {
|
2020-06-18 16:54:48 -04:00
|
|
|
// Already on the most recent URL in the history
|
|
|
|
return
|
|
|
|
}
|
2020-07-07 21:13:45 -04:00
|
|
|
t.history.pos++
|
|
|
|
go applyHist(t)
|
2020-06-18 16:54:48 -04:00
|
|
|
}
|
|
|
|
|
2021-06-25 19:03:41 -04:00
|
|
|
func (t *tab) histBack() {
|
2020-07-07 21:13:45 -04:00
|
|
|
if t.history.pos <= 0 {
|
2020-06-18 16:54:48 -04:00
|
|
|
// First tab in history
|
|
|
|
return
|
|
|
|
}
|
2020-07-07 21:13:45 -04:00
|
|
|
t.history.pos--
|
|
|
|
go applyHist(t)
|
2020-06-18 16:54:48 -04:00
|
|
|
}
|