mirror of
https://github.com/makeworld-the-better-one/amfora.git
synced 2024-11-26 10:15:13 +03:00
4452fcfec6
Co-authored-by: makeworld
26 lines
513 B
Go
26 lines
513 B
Go
package display
|
|
|
|
// applyHist is a history.go internal function, to load a URL in the history.
|
|
func applyHist(t *tab) {
|
|
handleURL(t, t.history.urls[t.history.pos], 0) // Load that position in history
|
|
t.applyAll()
|
|
}
|
|
|
|
func histForward(t *tab) {
|
|
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 histBack(t *tab) {
|
|
if t.history.pos <= 0 {
|
|
// First tab in history
|
|
return
|
|
}
|
|
t.history.pos--
|
|
go applyHist(t)
|
|
}
|