mirror of
https://github.com/makew0rld/amfora.git
synced 2024-12-04 14:46:29 -05:00
543d15abfc
Squashed commit of the following: commit72f36afc9e
Author: makeworld <colecmac@protonmail.com> Date: Tue Jul 7 16:15:45 2020 -0400 🚧 Scroll is applied correctly when navigating around commit4b8982723f
Author: makeworld <colecmac@protonmail.com> Date: Tue Jul 7 15:34:45 2020 -0400 🚧 Fix bottomBar code Make sure it always resets to a selected link if one was selected before commitbe09ffcf91
Author: makeworld <colecmac@protonmail.com> Date: Mon Jul 6 20:30:54 2020 -0400 🚧 Switch to using tab pointers instead of ints Almost finished overall work. commitef8ab3da39
Author: makeworld <colecmac@protonmail.com> Date: Mon Jul 6 12:10:50 2020 -0400 🚧 Fixed some bugs, major ones remain commitd3d47a344d
Author: makeworld <colecmac@protonmail.com> Date: Sat Jul 4 20:58:46 2020 -0400 🚧 Everything uses tab struct, no compile errors, untested commit44bf54c12f
Author: makeworld <colecmac@protonmail.com> Date: Sat Jul 4 13:24:49 2020 -0400 🚧 Initial work on tab struct
26 lines
510 B
Go
26 lines
510 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]) // 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)
|
|
}
|