mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-13 00:07:59 +02:00
Replace loader panels with waiting status (pull/push/fetch) (#2973)
This commit is contained in:
commit
07cbb62510
@ -537,14 +537,13 @@ func (self *BranchesController) fastForward(branch *models.Branch) error {
|
|||||||
action := self.c.Tr.Actions.FastForwardBranch
|
action := self.c.Tr.Actions.FastForwardBranch
|
||||||
|
|
||||||
message := utils.ResolvePlaceholderString(
|
message := utils.ResolvePlaceholderString(
|
||||||
self.c.Tr.Fetching,
|
self.c.Tr.FastForwarding,
|
||||||
map[string]string{
|
map[string]string{
|
||||||
"from": fmt.Sprintf("%s/%s", branch.UpstreamRemote, branch.UpstreamBranch),
|
"branch": branch.Name,
|
||||||
"to": branch.Name,
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
return self.c.WithLoaderPanel(message, func(task gocui.Task) error {
|
return self.c.WithWaitingStatus(message, func(task gocui.Task) error {
|
||||||
worktree, ok := self.worktreeForBranch(branch)
|
worktree, ok := self.worktreeForBranch(branch)
|
||||||
if ok {
|
if ok {
|
||||||
self.c.LogAction(action)
|
self.c.LogAction(action)
|
||||||
|
@ -800,7 +800,7 @@ func (self *FilesController) onClickSecondary(opts gocui.ViewMouseBindingOpts) e
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (self *FilesController) fetch() error {
|
func (self *FilesController) fetch() error {
|
||||||
return self.c.WithLoaderPanel(self.c.Tr.FetchWait, func(task gocui.Task) error {
|
return self.c.WithWaitingStatus(self.c.Tr.FetchingStatus, func(task gocui.Task) error {
|
||||||
if err := self.fetchAux(task); err != nil {
|
if err := self.fetchAux(task); err != nil {
|
||||||
_ = self.c.Error(err)
|
_ = self.c.Error(err)
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import (
|
|||||||
|
|
||||||
"github.com/jesseduffield/gocui"
|
"github.com/jesseduffield/gocui"
|
||||||
"github.com/jesseduffield/lazygit/pkg/gui/status"
|
"github.com/jesseduffield/lazygit/pkg/gui/status"
|
||||||
|
"github.com/jesseduffield/lazygit/pkg/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type AppStatusHelper struct {
|
type AppStatusHelper struct {
|
||||||
@ -77,7 +78,7 @@ func (self *AppStatusHelper) GetStatusString() string {
|
|||||||
|
|
||||||
func (self *AppStatusHelper) renderAppStatus() {
|
func (self *AppStatusHelper) renderAppStatus() {
|
||||||
self.c.OnWorker(func(_ gocui.Task) {
|
self.c.OnWorker(func(_ gocui.Task) {
|
||||||
ticker := time.NewTicker(time.Millisecond * 50)
|
ticker := time.NewTicker(time.Millisecond * utils.LoaderAnimationInterval)
|
||||||
defer ticker.Stop()
|
defer ticker.Stop()
|
||||||
for range ticker.C {
|
for range ticker.C {
|
||||||
appStatus := self.statusMgr().GetStatusString()
|
appStatus := self.statusMgr().GetStatusString()
|
||||||
|
@ -141,13 +141,8 @@ func (self *ConfirmationHelper) getPopupPanelWidth() int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (self *ConfirmationHelper) prepareConfirmationPanel(
|
func (self *ConfirmationHelper) prepareConfirmationPanel(
|
||||||
ctx goContext.Context,
|
|
||||||
opts types.ConfirmOpts,
|
opts types.ConfirmOpts,
|
||||||
) error {
|
) error {
|
||||||
self.c.Views().Confirmation.HasLoader = opts.HasLoader
|
|
||||||
if opts.HasLoader {
|
|
||||||
self.c.GocuiGui().StartTicking(ctx)
|
|
||||||
}
|
|
||||||
self.c.Views().Confirmation.Title = opts.Title
|
self.c.Views().Confirmation.Title = opts.Title
|
||||||
// for now we do not support wrapping in our editor
|
// for now we do not support wrapping in our editor
|
||||||
self.c.Views().Confirmation.Wrap = !opts.Editable
|
self.c.Views().Confirmation.Wrap = !opts.Editable
|
||||||
@ -181,7 +176,7 @@ func (self *ConfirmationHelper) CreatePopupPanel(ctx goContext.Context, opts typ
|
|||||||
self.c.Mutexes().PopupMutex.Lock()
|
self.c.Mutexes().PopupMutex.Lock()
|
||||||
defer self.c.Mutexes().PopupMutex.Unlock()
|
defer self.c.Mutexes().PopupMutex.Unlock()
|
||||||
|
|
||||||
ctx, cancel := goContext.WithCancel(ctx)
|
_, cancel := goContext.WithCancel(ctx)
|
||||||
|
|
||||||
// we don't allow interruptions of non-loader popups in case we get stuck somehow
|
// we don't allow interruptions of non-loader popups in case we get stuck somehow
|
||||||
// e.g. a credentials popup never gets its required user input so a process hangs
|
// e.g. a credentials popup never gets its required user input so a process hangs
|
||||||
@ -198,11 +193,9 @@ func (self *ConfirmationHelper) CreatePopupPanel(ctx goContext.Context, opts typ
|
|||||||
self.clearConfirmationViewKeyBindings()
|
self.clearConfirmationViewKeyBindings()
|
||||||
|
|
||||||
err := self.prepareConfirmationPanel(
|
err := self.prepareConfirmationPanel(
|
||||||
ctx,
|
|
||||||
types.ConfirmOpts{
|
types.ConfirmOpts{
|
||||||
Title: opts.Title,
|
Title: opts.Title,
|
||||||
Prompt: opts.Prompt,
|
Prompt: opts.Prompt,
|
||||||
HasLoader: opts.HasLoader,
|
|
||||||
FindSuggestionsFunc: opts.FindSuggestionsFunc,
|
FindSuggestionsFunc: opts.FindSuggestionsFunc,
|
||||||
Editable: opts.Editable,
|
Editable: opts.Editable,
|
||||||
Mask: opts.Mask,
|
Mask: opts.Mask,
|
||||||
|
@ -140,7 +140,7 @@ type PullFilesOptions struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (self *SyncController) PullAux(opts PullFilesOptions) error {
|
func (self *SyncController) PullAux(opts PullFilesOptions) error {
|
||||||
return self.c.WithLoaderPanel(self.c.Tr.PullWait, func(task gocui.Task) error {
|
return self.c.WithWaitingStatus(self.c.Tr.PullingStatus, func(task gocui.Task) error {
|
||||||
return self.pullWithLock(task, opts)
|
return self.pullWithLock(task, opts)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -168,7 +168,7 @@ type pushOpts struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (self *SyncController) pushAux(opts pushOpts) error {
|
func (self *SyncController) pushAux(opts pushOpts) error {
|
||||||
return self.c.WithLoaderPanel(self.c.Tr.PushWait, func(task gocui.Task) error {
|
return self.c.WithWaitingStatus(self.c.Tr.PushingStatus, func(task gocui.Task) error {
|
||||||
self.c.LogAction(self.c.Tr.Actions.Push)
|
self.c.LogAction(self.c.Tr.Actions.Push)
|
||||||
err := self.c.Git().Sync.Push(
|
err := self.c.Git().Sync.Push(
|
||||||
task,
|
task,
|
||||||
|
@ -487,7 +487,6 @@ func NewGui(
|
|||||||
func(message string, f func(gocui.Task) error) { gui.helpers.AppStatus.WithWaitingStatus(message, f) },
|
func(message string, f func(gocui.Task) error) { gui.helpers.AppStatus.WithWaitingStatus(message, f) },
|
||||||
func(message string) { gui.helpers.AppStatus.Toast(message) },
|
func(message string) { gui.helpers.AppStatus.Toast(message) },
|
||||||
func() string { return gui.Views.Confirmation.TextArea.GetContent() },
|
func() string { return gui.Views.Confirmation.TextArea.GetContent() },
|
||||||
func(f func(gocui.Task)) { gui.c.OnWorker(f) },
|
|
||||||
func() bool { return gui.c.InDemo() },
|
func() bool { return gui.c.InDemo() },
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1,54 +0,0 @@
|
|||||||
package popup
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/jesseduffield/gocui"
|
|
||||||
"github.com/jesseduffield/lazygit/pkg/gui/types"
|
|
||||||
)
|
|
||||||
|
|
||||||
type FakePopupHandler struct {
|
|
||||||
OnErrorMsg func(message string) error
|
|
||||||
OnConfirm func(opts types.ConfirmOpts) error
|
|
||||||
OnPrompt func(opts types.PromptOpts) error
|
|
||||||
}
|
|
||||||
|
|
||||||
var _ types.IPopupHandler = &FakePopupHandler{}
|
|
||||||
|
|
||||||
func (self *FakePopupHandler) Error(err error) error {
|
|
||||||
return self.ErrorMsg(err.Error())
|
|
||||||
}
|
|
||||||
|
|
||||||
func (self *FakePopupHandler) ErrorMsg(message string) error {
|
|
||||||
return self.OnErrorMsg(message)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (self *FakePopupHandler) Alert(title string, message string) error {
|
|
||||||
panic("not yet implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
func (self *FakePopupHandler) Confirm(opts types.ConfirmOpts) error {
|
|
||||||
return self.OnConfirm(opts)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (self *FakePopupHandler) Prompt(opts types.PromptOpts) error {
|
|
||||||
return self.OnPrompt(opts)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (self *FakePopupHandler) WithLoaderPanel(message string, f func(gocui.Task) error) error {
|
|
||||||
return f(gocui.NewFakeTask())
|
|
||||||
}
|
|
||||||
|
|
||||||
func (self *FakePopupHandler) WithWaitingStatus(message string, f func(gocui.Task) error) error {
|
|
||||||
return f(gocui.NewFakeTask())
|
|
||||||
}
|
|
||||||
|
|
||||||
func (self *FakePopupHandler) Menu(opts types.CreateMenuOptions) error {
|
|
||||||
panic("not yet implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
func (self *FakePopupHandler) Toast(message string) {
|
|
||||||
panic("not yet implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
func (self *FakePopupHandler) GetPromptInput() string {
|
|
||||||
panic("not yet implemented")
|
|
||||||
}
|
|
@ -3,11 +3,9 @@ package popup
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/jesseduffield/gocui"
|
"github.com/jesseduffield/gocui"
|
||||||
"github.com/jesseduffield/lazygit/pkg/common"
|
"github.com/jesseduffield/lazygit/pkg/common"
|
||||||
gctx "github.com/jesseduffield/lazygit/pkg/gui/context"
|
|
||||||
"github.com/jesseduffield/lazygit/pkg/gui/style"
|
"github.com/jesseduffield/lazygit/pkg/gui/style"
|
||||||
"github.com/jesseduffield/lazygit/pkg/gui/types"
|
"github.com/jesseduffield/lazygit/pkg/gui/types"
|
||||||
"github.com/sasha-s/go-deadlock"
|
"github.com/sasha-s/go-deadlock"
|
||||||
@ -25,7 +23,6 @@ type PopupHandler struct {
|
|||||||
withWaitingStatusFn func(message string, f func(gocui.Task) error)
|
withWaitingStatusFn func(message string, f func(gocui.Task) error)
|
||||||
toastFn func(message string)
|
toastFn func(message string)
|
||||||
getPromptInputFn func() string
|
getPromptInputFn func() string
|
||||||
onWorker func(func(gocui.Task))
|
|
||||||
inDemo func() bool
|
inDemo func() bool
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,7 +38,6 @@ func NewPopupHandler(
|
|||||||
withWaitingStatusFn func(message string, f func(gocui.Task) error),
|
withWaitingStatusFn func(message string, f func(gocui.Task) error),
|
||||||
toastFn func(message string),
|
toastFn func(message string),
|
||||||
getPromptInputFn func() string,
|
getPromptInputFn func() string,
|
||||||
onWorker func(func(gocui.Task)),
|
|
||||||
inDemo func() bool,
|
inDemo func() bool,
|
||||||
) *PopupHandler {
|
) *PopupHandler {
|
||||||
return &PopupHandler{
|
return &PopupHandler{
|
||||||
@ -55,7 +51,6 @@ func NewPopupHandler(
|
|||||||
withWaitingStatusFn: withWaitingStatusFn,
|
withWaitingStatusFn: withWaitingStatusFn,
|
||||||
toastFn: toastFn,
|
toastFn: toastFn,
|
||||||
getPromptInputFn: getPromptInputFn,
|
getPromptInputFn: getPromptInputFn,
|
||||||
onWorker: onWorker,
|
|
||||||
inDemo: inDemo,
|
inDemo: inDemo,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -128,47 +123,6 @@ func (self *PopupHandler) Prompt(opts types.PromptOpts) error {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *PopupHandler) WithLoaderPanel(message string, f func(gocui.Task) error) error {
|
|
||||||
index := 0
|
|
||||||
self.Lock()
|
|
||||||
self.index++
|
|
||||||
index = self.index
|
|
||||||
self.Unlock()
|
|
||||||
|
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
|
||||||
|
|
||||||
err := self.createPopupPanelFn(ctx, types.CreatePopupPanelOpts{
|
|
||||||
Prompt: message,
|
|
||||||
HasLoader: true,
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
self.Log.Error(err)
|
|
||||||
cancel()
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
self.onWorker(func(task gocui.Task) {
|
|
||||||
// emulating a delay due to network latency
|
|
||||||
if self.inDemo() {
|
|
||||||
time.Sleep(500 * time.Millisecond)
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := f(task); err != nil {
|
|
||||||
self.Log.Error(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
cancel()
|
|
||||||
|
|
||||||
self.Lock()
|
|
||||||
if index == self.index && self.currentContextFn().GetKey() == gctx.CONFIRMATION_CONTEXT_KEY {
|
|
||||||
_ = self.popContextFn()
|
|
||||||
}
|
|
||||||
self.Unlock()
|
|
||||||
})
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// returns the content that has currently been typed into the prompt. Useful for
|
// returns the content that has currently been typed into the prompt. Useful for
|
||||||
// asynchronously updating the suggestions list under the prompt.
|
// asynchronously updating the suggestions list under the prompt.
|
||||||
func (self *PopupHandler) GetPromptInput() string {
|
func (self *PopupHandler) GetPromptInput() string {
|
||||||
|
@ -134,7 +134,6 @@ type IPopupHandler interface {
|
|||||||
Confirm(opts ConfirmOpts) error
|
Confirm(opts ConfirmOpts) error
|
||||||
// Shows a popup prompting the user for input.
|
// Shows a popup prompting the user for input.
|
||||||
Prompt(opts PromptOpts) error
|
Prompt(opts PromptOpts) error
|
||||||
WithLoaderPanel(message string, f func(gocui.Task) error) error
|
|
||||||
WithWaitingStatus(message string, f func(gocui.Task) error) error
|
WithWaitingStatus(message string, f func(gocui.Task) error) error
|
||||||
Menu(opts CreateMenuOptions) error
|
Menu(opts CreateMenuOptions) error
|
||||||
Toast(message string)
|
Toast(message string)
|
||||||
@ -166,7 +165,6 @@ type ConfirmOpts struct {
|
|||||||
Prompt string
|
Prompt string
|
||||||
HandleConfirm func() error
|
HandleConfirm func() error
|
||||||
HandleClose func() error
|
HandleClose func() error
|
||||||
HasLoader bool
|
|
||||||
FindSuggestionsFunc func(string) []*Suggestion
|
FindSuggestionsFunc func(string) []*Suggestion
|
||||||
Editable bool
|
Editable bool
|
||||||
Mask bool
|
Mask bool
|
||||||
|
@ -72,9 +72,6 @@ func chineseTranslationSet() TranslationSet {
|
|||||||
MergeConflictsTitle: "合并冲突",
|
MergeConflictsTitle: "合并冲突",
|
||||||
Checkout: "检出",
|
Checkout: "检出",
|
||||||
NoChangedFiles: "没有更改过文件",
|
NoChangedFiles: "没有更改过文件",
|
||||||
PullWait: "正在拉取…",
|
|
||||||
PushWait: "正在推送…",
|
|
||||||
FetchWait: "正在抓取…",
|
|
||||||
SoftReset: "软重置",
|
SoftReset: "软重置",
|
||||||
AlreadyCheckedOutBranch: "您已经检出至此分支",
|
AlreadyCheckedOutBranch: "您已经检出至此分支",
|
||||||
SureForceCheckout: "您确定要强制检出吗?您将丢失所有本地更改",
|
SureForceCheckout: "您确定要强制检出吗?您将丢失所有本地更改",
|
||||||
@ -172,7 +169,7 @@ func chineseTranslationSet() TranslationSet {
|
|||||||
ToggleStagingPanel: `切换到其他面板`,
|
ToggleStagingPanel: `切换到其他面板`,
|
||||||
ReturnToFilesPanel: `返回文件面板`,
|
ReturnToFilesPanel: `返回文件面板`,
|
||||||
FastForward: `从上游快进此分支`,
|
FastForward: `从上游快进此分支`,
|
||||||
Fetching: "抓取并快进 {{.from}} -> {{.to}} ...",
|
FastForwarding: "抓取并快进 {{.branch}} ...",
|
||||||
FoundConflictsTitle: "自动合并失败",
|
FoundConflictsTitle: "自动合并失败",
|
||||||
ViewMergeRebaseOptions: "查看 合并/变基 选项",
|
ViewMergeRebaseOptions: "查看 合并/变基 选项",
|
||||||
NotMergingOrRebasing: "您目前既不进行变基也不进行合并",
|
NotMergingOrRebasing: "您目前既不进行变基也不进行合并",
|
||||||
@ -223,6 +220,9 @@ func chineseTranslationSet() TranslationSet {
|
|||||||
AmendCommitPrompt: "您确定要使用暂存文件来修改此提交吗?",
|
AmendCommitPrompt: "您确定要使用暂存文件来修改此提交吗?",
|
||||||
DeleteCommitTitle: "删除提交",
|
DeleteCommitTitle: "删除提交",
|
||||||
DeleteCommitPrompt: "您确定要删除此提交吗?",
|
DeleteCommitPrompt: "您确定要删除此提交吗?",
|
||||||
|
PullingStatus: "正在拉取",
|
||||||
|
PushingStatus: "正在推送",
|
||||||
|
FetchingStatus: "正在抓取",
|
||||||
SquashingStatus: "正在压缩",
|
SquashingStatus: "正在压缩",
|
||||||
FixingStatus: "正在修正",
|
FixingStatus: "正在修正",
|
||||||
DeletingStatus: "正在删除",
|
DeletingStatus: "正在删除",
|
||||||
|
@ -38,9 +38,6 @@ func dutchTranslationSet() TranslationSet {
|
|||||||
ResetFilter: "Reset commit file state filter",
|
ResetFilter: "Reset commit file state filter",
|
||||||
MergeConflictsTitle: "Merge conflicten",
|
MergeConflictsTitle: "Merge conflicten",
|
||||||
Checkout: "Uitchecken",
|
Checkout: "Uitchecken",
|
||||||
PullWait: "Pullen...",
|
|
||||||
PushWait: "Pushen...",
|
|
||||||
FetchWait: "Fetchen...",
|
|
||||||
SoftReset: "Zacht reset",
|
SoftReset: "Zacht reset",
|
||||||
AlreadyCheckedOutBranch: "Je hebt deze branch al uitgecheckt",
|
AlreadyCheckedOutBranch: "Je hebt deze branch al uitgecheckt",
|
||||||
SureForceCheckout: "Weet je zeker dat je het uitchecken wil forceren? Al je lokale verandering zullen worden verwijdert",
|
SureForceCheckout: "Weet je zeker dat je het uitchecken wil forceren? Al je lokale verandering zullen worden verwijdert",
|
||||||
@ -137,7 +134,7 @@ func dutchTranslationSet() TranslationSet {
|
|||||||
ToggleStagingPanel: `Ga naar een ander paneel`,
|
ToggleStagingPanel: `Ga naar een ander paneel`,
|
||||||
ReturnToFilesPanel: `Ga terug naar het bestanden paneel`,
|
ReturnToFilesPanel: `Ga terug naar het bestanden paneel`,
|
||||||
FastForward: `Fast-forward deze branch vanaf zijn upstream`,
|
FastForward: `Fast-forward deze branch vanaf zijn upstream`,
|
||||||
Fetching: "Fetching en fast-forwarding {{.from}} -> {{.to}} ...",
|
FastForwarding: "Fast-forwarding {{.branch}} ...",
|
||||||
FoundConflictsTitle: "Conflicten!",
|
FoundConflictsTitle: "Conflicten!",
|
||||||
ViewMergeRebaseOptions: "Bekijk merge/rebase opties",
|
ViewMergeRebaseOptions: "Bekijk merge/rebase opties",
|
||||||
NotMergingOrRebasing: "Je bent momenteel niet aan het rebasen of mergen",
|
NotMergingOrRebasing: "Je bent momenteel niet aan het rebasen of mergen",
|
||||||
@ -187,6 +184,9 @@ func dutchTranslationSet() TranslationSet {
|
|||||||
AmendCommitPrompt: "Weet je zeker dat je deze commit wil wijzigen met de vorige staged bestanden?",
|
AmendCommitPrompt: "Weet je zeker dat je deze commit wil wijzigen met de vorige staged bestanden?",
|
||||||
DeleteCommitTitle: "Verwijder commit",
|
DeleteCommitTitle: "Verwijder commit",
|
||||||
DeleteCommitPrompt: "Weet je zeker dat je deze commit wil verwijderen?",
|
DeleteCommitPrompt: "Weet je zeker dat je deze commit wil verwijderen?",
|
||||||
|
PullingStatus: "Pullen",
|
||||||
|
PushingStatus: "Pushen",
|
||||||
|
FetchingStatus: "Fetchen",
|
||||||
SquashingStatus: "Squashen",
|
SquashingStatus: "Squashen",
|
||||||
FixingStatus: "Fixing up",
|
FixingStatus: "Fixing up",
|
||||||
DeletingStatus: "Verwijderen",
|
DeletingStatus: "Verwijderen",
|
||||||
|
@ -58,9 +58,6 @@ type TranslationSet struct {
|
|||||||
MergeConflictsTitle string
|
MergeConflictsTitle string
|
||||||
Checkout string
|
Checkout string
|
||||||
NoChangedFiles string
|
NoChangedFiles string
|
||||||
PullWait string
|
|
||||||
PushWait string
|
|
||||||
FetchWait string
|
|
||||||
SoftReset string
|
SoftReset string
|
||||||
AlreadyCheckedOutBranch string
|
AlreadyCheckedOutBranch string
|
||||||
SureForceCheckout string
|
SureForceCheckout string
|
||||||
@ -187,7 +184,7 @@ type TranslationSet struct {
|
|||||||
ToggleStagingPanel string
|
ToggleStagingPanel string
|
||||||
ReturnToFilesPanel string
|
ReturnToFilesPanel string
|
||||||
FastForward string
|
FastForward string
|
||||||
Fetching string
|
FastForwarding string
|
||||||
FoundConflictsTitle string
|
FoundConflictsTitle string
|
||||||
ViewConflictsMenuItem string
|
ViewConflictsMenuItem string
|
||||||
AbortMenuItem string
|
AbortMenuItem string
|
||||||
@ -253,6 +250,9 @@ type TranslationSet struct {
|
|||||||
AmendCommitPrompt string
|
AmendCommitPrompt string
|
||||||
DeleteCommitTitle string
|
DeleteCommitTitle string
|
||||||
DeleteCommitPrompt string
|
DeleteCommitPrompt string
|
||||||
|
PullingStatus string
|
||||||
|
PushingStatus string
|
||||||
|
FetchingStatus string
|
||||||
SquashingStatus string
|
SquashingStatus string
|
||||||
FixingStatus string
|
FixingStatus string
|
||||||
DeletingStatus string
|
DeletingStatus string
|
||||||
@ -848,9 +848,6 @@ func EnglishTranslationSet() TranslationSet {
|
|||||||
FilterUnstagedFiles: "Show only unstaged files",
|
FilterUnstagedFiles: "Show only unstaged files",
|
||||||
ResetFilter: "Reset filter",
|
ResetFilter: "Reset filter",
|
||||||
NoChangedFiles: "No changed files",
|
NoChangedFiles: "No changed files",
|
||||||
PullWait: "Pulling...",
|
|
||||||
PushWait: "Pushing...",
|
|
||||||
FetchWait: "Fetching...",
|
|
||||||
SoftReset: "Soft reset",
|
SoftReset: "Soft reset",
|
||||||
AlreadyCheckedOutBranch: "You have already checked out this branch",
|
AlreadyCheckedOutBranch: "You have already checked out this branch",
|
||||||
SureForceCheckout: "Are you sure you want force checkout? You will lose all local changes",
|
SureForceCheckout: "Are you sure you want force checkout? You will lose all local changes",
|
||||||
@ -980,7 +977,7 @@ func EnglishTranslationSet() TranslationSet {
|
|||||||
ToggleStagingPanel: `Switch to other panel (staged/unstaged changes)`,
|
ToggleStagingPanel: `Switch to other panel (staged/unstaged changes)`,
|
||||||
ReturnToFilesPanel: `Return to files panel`,
|
ReturnToFilesPanel: `Return to files panel`,
|
||||||
FastForward: `Fast-forward this branch from its upstream`,
|
FastForward: `Fast-forward this branch from its upstream`,
|
||||||
Fetching: "Fetching and fast-forwarding {{.from}} -> {{.to}} ...",
|
FastForwarding: "Fast-forwarding {{.branch}}",
|
||||||
FoundConflictsTitle: "Conflicts!",
|
FoundConflictsTitle: "Conflicts!",
|
||||||
ViewConflictsMenuItem: "View conflicts",
|
ViewConflictsMenuItem: "View conflicts",
|
||||||
AbortMenuItem: "Abort the %s",
|
AbortMenuItem: "Abort the %s",
|
||||||
@ -1049,6 +1046,9 @@ func EnglishTranslationSet() TranslationSet {
|
|||||||
AmendCommitPrompt: "Are you sure you want to amend this commit with your staged files?",
|
AmendCommitPrompt: "Are you sure you want to amend this commit with your staged files?",
|
||||||
DeleteCommitTitle: "Delete commit",
|
DeleteCommitTitle: "Delete commit",
|
||||||
DeleteCommitPrompt: "Are you sure you want to delete this commit?",
|
DeleteCommitPrompt: "Are you sure you want to delete this commit?",
|
||||||
|
PullingStatus: "Pulling",
|
||||||
|
PushingStatus: "Pushing",
|
||||||
|
FetchingStatus: "Fetching",
|
||||||
SquashingStatus: "Squashing",
|
SquashingStatus: "Squashing",
|
||||||
FixingStatus: "Fixing up",
|
FixingStatus: "Fixing up",
|
||||||
DeletingStatus: "Deleting",
|
DeletingStatus: "Deleting",
|
||||||
|
@ -63,9 +63,6 @@ func japaneseTranslationSet() TranslationSet {
|
|||||||
FilterUnstagedFiles: "ステージされていないファイルのみを表示",
|
FilterUnstagedFiles: "ステージされていないファイルのみを表示",
|
||||||
ResetFilter: "フィルタをリセット",
|
ResetFilter: "フィルタをリセット",
|
||||||
// NoChangedFiles: "No changed files",
|
// NoChangedFiles: "No changed files",
|
||||||
PullWait: "Pull中...",
|
|
||||||
PushWait: "Push中...",
|
|
||||||
FetchWait: "Fetch中...",
|
|
||||||
SoftReset: "Softリセット",
|
SoftReset: "Softリセット",
|
||||||
AlreadyCheckedOutBranch: "ブランチはすでにチェックアウトされています。",
|
AlreadyCheckedOutBranch: "ブランチはすでにチェックアウトされています。",
|
||||||
// SureForceCheckout: "Are you sure you want force checkout? You will lose all local changes",
|
// SureForceCheckout: "Are you sure you want force checkout? You will lose all local changes",
|
||||||
@ -227,6 +224,9 @@ func japaneseTranslationSet() TranslationSet {
|
|||||||
AmendCommitPrompt: "ステージされたファイルで現在のコミットをamendします。よろしいですか?",
|
AmendCommitPrompt: "ステージされたファイルで現在のコミットをamendします。よろしいですか?",
|
||||||
DeleteCommitTitle: "コミットを削除",
|
DeleteCommitTitle: "コミットを削除",
|
||||||
DeleteCommitPrompt: "選択されたコミットを削除します。よろしいですか?",
|
DeleteCommitPrompt: "選択されたコミットを削除します。よろしいですか?",
|
||||||
|
PullingStatus: "Pull中",
|
||||||
|
PushingStatus: "Push中",
|
||||||
|
FetchingStatus: "Fetch中",
|
||||||
// SquashingStatus: "Squashing",
|
// SquashingStatus: "Squashing",
|
||||||
// FixingStatus: "Fixing up",
|
// FixingStatus: "Fixing up",
|
||||||
// DeletingStatus: "Deleting",
|
// DeletingStatus: "Deleting",
|
||||||
|
@ -62,9 +62,6 @@ func koreanTranslationSet() TranslationSet {
|
|||||||
FilterUnstagedFiles: "Stage되지 않은 파일만 표시",
|
FilterUnstagedFiles: "Stage되지 않은 파일만 표시",
|
||||||
ResetFilter: "필터 리셋",
|
ResetFilter: "필터 리셋",
|
||||||
NoChangedFiles: "변경된 파일이 없습니다.",
|
NoChangedFiles: "변경된 파일이 없습니다.",
|
||||||
PullWait: "업데이트 중...",
|
|
||||||
PushWait: "푸시 중...",
|
|
||||||
FetchWait: "패치 중...",
|
|
||||||
SoftReset: "소프트 리셋",
|
SoftReset: "소프트 리셋",
|
||||||
AlreadyCheckedOutBranch: "브랜치가 이미 체크아웃 되었습니다",
|
AlreadyCheckedOutBranch: "브랜치가 이미 체크아웃 되었습니다",
|
||||||
SureForceCheckout: "강제로 체크아웃하시겠습니까? 모든 로컬 변경 사항을 잃게 됩니다.",
|
SureForceCheckout: "강제로 체크아웃하시겠습니까? 모든 로컬 변경 사항을 잃게 됩니다.",
|
||||||
@ -173,7 +170,7 @@ func koreanTranslationSet() TranslationSet {
|
|||||||
ToggleStagingPanel: `패널 전환`,
|
ToggleStagingPanel: `패널 전환`,
|
||||||
ReturnToFilesPanel: `파일 목록으로 돌아가기`,
|
ReturnToFilesPanel: `파일 목록으로 돌아가기`,
|
||||||
FastForward: `Fast-forward this branch from its upstream`,
|
FastForward: `Fast-forward this branch from its upstream`,
|
||||||
Fetching: "Fetching and fast-forwarding {{.from}} -> {{.to}} ...",
|
FastForwarding: "Fast-forwarding {{.branch}} ...",
|
||||||
FoundConflictsTitle: "Auto-merge failed",
|
FoundConflictsTitle: "Auto-merge failed",
|
||||||
ViewMergeRebaseOptions: "View merge/rebase options",
|
ViewMergeRebaseOptions: "View merge/rebase options",
|
||||||
NotMergingOrRebasing: "You are currently neither rebasing nor merging",
|
NotMergingOrRebasing: "You are currently neither rebasing nor merging",
|
||||||
@ -224,6 +221,9 @@ func koreanTranslationSet() TranslationSet {
|
|||||||
AmendCommitPrompt: "Are you sure you want to amend this commit with your staged files?",
|
AmendCommitPrompt: "Are you sure you want to amend this commit with your staged files?",
|
||||||
DeleteCommitTitle: "커밋 삭제",
|
DeleteCommitTitle: "커밋 삭제",
|
||||||
DeleteCommitPrompt: "정말로 선택한 커밋을 삭제하시겠습니까?",
|
DeleteCommitPrompt: "정말로 선택한 커밋을 삭제하시겠습니까?",
|
||||||
|
PullingStatus: "업데이트 중",
|
||||||
|
PushingStatus: "푸시 중",
|
||||||
|
FetchingStatus: "패치 중",
|
||||||
SquashingStatus: "Squashing",
|
SquashingStatus: "Squashing",
|
||||||
FixingStatus: "Fixing up",
|
FixingStatus: "Fixing up",
|
||||||
DeletingStatus: "Deleting",
|
DeletingStatus: "Deleting",
|
||||||
|
@ -34,9 +34,6 @@ func polishTranslationSet() TranslationSet {
|
|||||||
ResetFilter: "Resetuj filtr commitów",
|
ResetFilter: "Resetuj filtr commitów",
|
||||||
Checkout: "Przełącz",
|
Checkout: "Przełącz",
|
||||||
NoChangedFiles: "Brak zmienionych plików",
|
NoChangedFiles: "Brak zmienionych plików",
|
||||||
PullWait: "Pobieranie zmian...",
|
|
||||||
PushWait: "Wysyłanie zmian...",
|
|
||||||
FetchWait: "Pobieram...",
|
|
||||||
AlreadyCheckedOutBranch: "Już przęłączono na tą gałąź",
|
AlreadyCheckedOutBranch: "Już przęłączono na tą gałąź",
|
||||||
SureForceCheckout: "Jesteś pewny, że chcesz wymusić przełączenie? Stracisz wszystkie lokalne zmiany",
|
SureForceCheckout: "Jesteś pewny, że chcesz wymusić przełączenie? Stracisz wszystkie lokalne zmiany",
|
||||||
ForceCheckoutBranch: "Wymuś przełączenie gałęzi",
|
ForceCheckoutBranch: "Wymuś przełączenie gałęzi",
|
||||||
@ -153,6 +150,9 @@ func polishTranslationSet() TranslationSet {
|
|||||||
AmendCommitPrompt: "Czy na pewno chcesz poprawić ten commit plikami z poczekalni?",
|
AmendCommitPrompt: "Czy na pewno chcesz poprawić ten commit plikami z poczekalni?",
|
||||||
DeleteCommitTitle: "Usuń commit",
|
DeleteCommitTitle: "Usuń commit",
|
||||||
DeleteCommitPrompt: "Czy na pewno usunąć ten commit?",
|
DeleteCommitPrompt: "Czy na pewno usunąć ten commit?",
|
||||||
|
PullingStatus: "Pobieranie zmian",
|
||||||
|
PushingStatus: "Wysyłanie zmian",
|
||||||
|
FetchingStatus: "Pobieram",
|
||||||
SquashingStatus: "Spłaszczanie",
|
SquashingStatus: "Spłaszczanie",
|
||||||
FixingStatus: "Naprawianie",
|
FixingStatus: "Naprawianie",
|
||||||
DeletingStatus: "Usuwanie",
|
DeletingStatus: "Usuwanie",
|
||||||
|
@ -81,9 +81,6 @@ func RussianTranslationSet() TranslationSet {
|
|||||||
FilterUnstagedFiles: "Показывать только непроиндексированные файлы",
|
FilterUnstagedFiles: "Показывать только непроиндексированные файлы",
|
||||||
ResetFilter: "Сбросить фильтр",
|
ResetFilter: "Сбросить фильтр",
|
||||||
NoChangedFiles: "Нет изменённых файлов",
|
NoChangedFiles: "Нет изменённых файлов",
|
||||||
PullWait: "Получение и слияние изменении...",
|
|
||||||
PushWait: "Отправка изменении...",
|
|
||||||
FetchWait: "Получение изменении...",
|
|
||||||
SoftReset: "Мягкий сброс",
|
SoftReset: "Мягкий сброс",
|
||||||
AlreadyCheckedOutBranch: "Вы уже переключились в эту ветку",
|
AlreadyCheckedOutBranch: "Вы уже переключились в эту ветку",
|
||||||
SureForceCheckout: "Вы уверены, что хотите принудительная переключить? Вы потеряете все локальные изменения",
|
SureForceCheckout: "Вы уверены, что хотите принудительная переключить? Вы потеряете все локальные изменения",
|
||||||
@ -204,7 +201,7 @@ func RussianTranslationSet() TranslationSet {
|
|||||||
ToggleStagingPanel: `Переключиться на другую панель (проиндексированные/непроиндексированные изменения)`,
|
ToggleStagingPanel: `Переключиться на другую панель (проиндексированные/непроиндексированные изменения)`,
|
||||||
ReturnToFilesPanel: `Вернуться к панели файлов`,
|
ReturnToFilesPanel: `Вернуться к панели файлов`,
|
||||||
FastForward: `Перемотать эту ветку вперёд из её upstream-ветки`,
|
FastForward: `Перемотать эту ветку вперёд из её upstream-ветки`,
|
||||||
Fetching: "Получить изменения и перемотать вперёд {{.from}} -> {{.to}} ...",
|
FastForwarding: "Получить изменения и перемотать вперёд {{.branch}} ...",
|
||||||
FoundConflictsTitle: "Конфликты!",
|
FoundConflictsTitle: "Конфликты!",
|
||||||
ViewConflictsMenuItem: "Просмотр конфликтов",
|
ViewConflictsMenuItem: "Просмотр конфликтов",
|
||||||
AbortMenuItem: "Прервать %s",
|
AbortMenuItem: "Прервать %s",
|
||||||
@ -268,6 +265,9 @@ func RussianTranslationSet() TranslationSet {
|
|||||||
AmendCommitPrompt: "Вы уверены, что хотите править этот коммит проиндексированными файлами?",
|
AmendCommitPrompt: "Вы уверены, что хотите править этот коммит проиндексированными файлами?",
|
||||||
DeleteCommitTitle: "Удалить коммит",
|
DeleteCommitTitle: "Удалить коммит",
|
||||||
DeleteCommitPrompt: "Вы уверены, что хотите удалить этот коммит?",
|
DeleteCommitPrompt: "Вы уверены, что хотите удалить этот коммит?",
|
||||||
|
PullingStatus: "Получение и слияние изменении",
|
||||||
|
PushingStatus: "Отправка изменении",
|
||||||
|
FetchingStatus: "Получение изменении",
|
||||||
SquashingStatus: "Объединение коммитов",
|
SquashingStatus: "Объединение коммитов",
|
||||||
FixingStatus: "Объединение коммитов, отбросив сообщение коммита",
|
FixingStatus: "Объединение коммитов, отбросив сообщение коммита",
|
||||||
DeletingStatus: "Удаление",
|
DeletingStatus: "Удаление",
|
||||||
|
@ -114,9 +114,6 @@ func traditionalChineseTranslationSet() TranslationSet {
|
|||||||
FilterUnstagedFiles: "僅顯示未預存的檔案",
|
FilterUnstagedFiles: "僅顯示未預存的檔案",
|
||||||
ResetFilter: "重設篩選",
|
ResetFilter: "重設篩選",
|
||||||
NoChangedFiles: "沒有變更的檔案",
|
NoChangedFiles: "沒有變更的檔案",
|
||||||
PullWait: "拉取...",
|
|
||||||
PushWait: "推送...",
|
|
||||||
FetchWait: "擷取...",
|
|
||||||
SoftReset: "軟重設",
|
SoftReset: "軟重設",
|
||||||
AlreadyCheckedOutBranch: "你已經檢出這個分支了",
|
AlreadyCheckedOutBranch: "你已經檢出這個分支了",
|
||||||
SureForceCheckout: "你確定要強制檢出嗎?這將會使你失去本地的所有更改",
|
SureForceCheckout: "你確定要強制檢出嗎?這將會使你失去本地的所有更改",
|
||||||
@ -237,7 +234,7 @@ func traditionalChineseTranslationSet() TranslationSet {
|
|||||||
ToggleStagingPanel: `切換至另一個面板 (已預存/未預存更改)`,
|
ToggleStagingPanel: `切換至另一個面板 (已預存/未預存更改)`,
|
||||||
ReturnToFilesPanel: `返回檔案面板`,
|
ReturnToFilesPanel: `返回檔案面板`,
|
||||||
FastForward: `從上游快進此分支`,
|
FastForward: `從上游快進此分支`,
|
||||||
Fetching: "{{.from}} -> {{.to}} 的擷取和快進中...",
|
FastForwarding: "{{.branch}} 的擷取和快進中...",
|
||||||
FoundConflictsTitle: "自動合併失敗",
|
FoundConflictsTitle: "自動合併失敗",
|
||||||
ViewMergeRebaseOptions: "查看合併/變基選項",
|
ViewMergeRebaseOptions: "查看合併/變基選項",
|
||||||
NotMergingOrRebasing: "你當前既不在變基也不在合併中",
|
NotMergingOrRebasing: "你當前既不在變基也不在合併中",
|
||||||
@ -299,6 +296,9 @@ func traditionalChineseTranslationSet() TranslationSet {
|
|||||||
AmendCommitPrompt: "你確定要使用預存的檔案修正此提交嗎?",
|
AmendCommitPrompt: "你確定要使用預存的檔案修正此提交嗎?",
|
||||||
DeleteCommitTitle: "刪除提交",
|
DeleteCommitTitle: "刪除提交",
|
||||||
DeleteCommitPrompt: "你確定要刪除此提交嗎?",
|
DeleteCommitPrompt: "你確定要刪除此提交嗎?",
|
||||||
|
PullingStatus: "拉取",
|
||||||
|
PushingStatus: "推送",
|
||||||
|
FetchingStatus: "擷取",
|
||||||
SquashingStatus: "壓縮中",
|
SquashingStatus: "壓縮中",
|
||||||
FixingStatus: "修復中",
|
FixingStatus: "修復中",
|
||||||
DeletingStatus: "刪除中",
|
DeletingStatus: "刪除中",
|
||||||
|
@ -24,12 +24,15 @@ func GetProjectRoot() string {
|
|||||||
return strings.Split(dir, "lazygit")[0] + "lazygit"
|
return strings.Split(dir, "lazygit")[0] + "lazygit"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The duration between two frames of the loader animation in milliseconds
|
||||||
|
const LoaderAnimationInterval = 50
|
||||||
|
|
||||||
// Loader dumps a string to be displayed as a loader
|
// Loader dumps a string to be displayed as a loader
|
||||||
func Loader() string {
|
func Loader() string {
|
||||||
characters := "|/-\\"
|
characters := "|/-\\"
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
nanos := now.UnixNano()
|
milliseconds := now.UnixMilli()
|
||||||
index := nanos / 50000000 % int64(len(characters))
|
index := milliseconds / LoaderAnimationInterval % int64(len(characters))
|
||||||
return characters[index : index+1]
|
return characters[index : index+1]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user