mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-04-24 20:56:17 +02:00
252dda5220
It is very gui specific and shouldn't be in a low-level utils package.
15 lines
344 B
Go
15 lines
344 B
Go
package presentation
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/jesseduffield/lazygit/pkg/config"
|
|
)
|
|
|
|
// Loader dumps a string to be displayed as a loader
|
|
func Loader(now time.Time, config config.SpinnerConfig) string {
|
|
milliseconds := now.UnixMilli()
|
|
index := milliseconds / int64(config.Rate) % int64(len(config.Frames))
|
|
return config.Frames[index]
|
|
}
|