mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Move Loader to presentation package
It is very gui specific and shouldn't be in a low-level utils package.
This commit is contained in:
@ -8,10 +8,8 @@ import (
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/jesseduffield/gocui"
|
||||
"github.com/jesseduffield/lazygit/pkg/config"
|
||||
)
|
||||
|
||||
// GetProjectRoot returns the path to the root of the project. Only to be used
|
||||
@ -25,13 +23,6 @@ func GetProjectRoot() string {
|
||||
return strings.Split(dir, "lazygit")[0] + "lazygit"
|
||||
}
|
||||
|
||||
// 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]
|
||||
}
|
||||
|
||||
func SortRange(x int, y int) (int, int) {
|
||||
if x < y {
|
||||
return x, y
|
||||
|
Reference in New Issue
Block a user