mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
use camelCase
This commit is contained in:
@ -191,7 +191,7 @@ func (gui *Gui) contextTree() ContextTree {
|
|||||||
},
|
},
|
||||||
Kind: MAIN_CONTEXT,
|
Kind: MAIN_CONTEXT,
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Key: "patch-building",
|
Key: "patchBuilding",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Merging: SimpleContextNode{
|
Merging: SimpleContextNode{
|
||||||
@ -526,7 +526,7 @@ func (gui *Gui) changeMainViewsContext(context string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch context {
|
switch context {
|
||||||
case "normal", "patch-building", "staging", "merging":
|
case "normal", "patchBuilding", "staging", "merging":
|
||||||
gui.getMainView().Context = context
|
gui.getMainView().Context = context
|
||||||
gui.getSecondaryView().Context = context
|
gui.getSecondaryView().Context = context
|
||||||
default:
|
default:
|
||||||
|
@ -44,7 +44,7 @@ func (gui *Gui) currentDiffTerminals() []string {
|
|||||||
switch gui.currentContextKey() {
|
switch gui.currentContextKey() {
|
||||||
case "files":
|
case "files":
|
||||||
// not supporting files for now
|
// not supporting files for now
|
||||||
case "commit-files":
|
case "commitFiles":
|
||||||
// not supporting commit files for now
|
// not supporting commit files for now
|
||||||
case "branch-commits":
|
case "branch-commits":
|
||||||
item := gui.getSelectedCommit()
|
item := gui.getSelectedCommit()
|
||||||
|
@ -998,84 +998,84 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patch-building"},
|
Contexts: []string{"patchBuilding"},
|
||||||
Key: gui.getKey("universal.return"),
|
Key: gui.getKey("universal.return"),
|
||||||
Handler: gui.wrappedHandler(gui.handleEscapePatchBuildingPanel),
|
Handler: gui.wrappedHandler(gui.handleEscapePatchBuildingPanel),
|
||||||
Description: gui.Tr.SLocalize("ExitLineByLineMode"),
|
Description: gui.Tr.SLocalize("ExitLineByLineMode"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patch-building", "staging"},
|
Contexts: []string{"patchBuilding", "staging"},
|
||||||
Key: gui.getKey("universal.openFile"),
|
Key: gui.getKey("universal.openFile"),
|
||||||
Handler: gui.wrappedHandler(gui.handleOpenFileAtLine),
|
Handler: gui.wrappedHandler(gui.handleOpenFileAtLine),
|
||||||
Description: gui.Tr.SLocalize("openFile"),
|
Description: gui.Tr.SLocalize("openFile"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patch-building", "staging"},
|
Contexts: []string{"patchBuilding", "staging"},
|
||||||
Key: gui.getKey("universal.prevItem"),
|
Key: gui.getKey("universal.prevItem"),
|
||||||
Handler: gui.handleSelectPrevLine,
|
Handler: gui.handleSelectPrevLine,
|
||||||
Description: gui.Tr.SLocalize("PrevLine"),
|
Description: gui.Tr.SLocalize("PrevLine"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patch-building", "staging"},
|
Contexts: []string{"patchBuilding", "staging"},
|
||||||
Key: gui.getKey("universal.nextItem"),
|
Key: gui.getKey("universal.nextItem"),
|
||||||
Handler: gui.handleSelectNextLine,
|
Handler: gui.handleSelectNextLine,
|
||||||
Description: gui.Tr.SLocalize("NextLine"),
|
Description: gui.Tr.SLocalize("NextLine"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patch-building", "staging"},
|
Contexts: []string{"patchBuilding", "staging"},
|
||||||
Key: gui.getKey("universal.prevItem-alt"),
|
Key: gui.getKey("universal.prevItem-alt"),
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleSelectPrevLine,
|
Handler: gui.handleSelectPrevLine,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patch-building", "staging"},
|
Contexts: []string{"patchBuilding", "staging"},
|
||||||
Key: gui.getKey("universal.nextItem-alt"),
|
Key: gui.getKey("universal.nextItem-alt"),
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleSelectNextLine,
|
Handler: gui.handleSelectNextLine,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patch-building", "staging"},
|
Contexts: []string{"patchBuilding", "staging"},
|
||||||
Key: gocui.MouseWheelUp,
|
Key: gocui.MouseWheelUp,
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleSelectPrevLine,
|
Handler: gui.handleSelectPrevLine,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patch-building", "staging"},
|
Contexts: []string{"patchBuilding", "staging"},
|
||||||
Key: gocui.MouseWheelDown,
|
Key: gocui.MouseWheelDown,
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleSelectNextLine,
|
Handler: gui.handleSelectNextLine,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patch-building", "staging"},
|
Contexts: []string{"patchBuilding", "staging"},
|
||||||
Key: gui.getKey("universal.prevBlock"),
|
Key: gui.getKey("universal.prevBlock"),
|
||||||
Handler: gui.handleSelectPrevHunk,
|
Handler: gui.handleSelectPrevHunk,
|
||||||
Description: gui.Tr.SLocalize("PrevHunk"),
|
Description: gui.Tr.SLocalize("PrevHunk"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patch-building", "staging"},
|
Contexts: []string{"patchBuilding", "staging"},
|
||||||
Key: gui.getKey("universal.nextBlock"),
|
Key: gui.getKey("universal.nextBlock"),
|
||||||
Handler: gui.handleSelectNextHunk,
|
Handler: gui.handleSelectNextHunk,
|
||||||
Description: gui.Tr.SLocalize("NextHunk"),
|
Description: gui.Tr.SLocalize("NextHunk"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patch-building", "staging"},
|
Contexts: []string{"patchBuilding", "staging"},
|
||||||
Key: gui.getKey("universal.prevBlock-alt"),
|
Key: gui.getKey("universal.prevBlock-alt"),
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleSelectPrevHunk,
|
Handler: gui.handleSelectPrevHunk,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patch-building", "staging"},
|
Contexts: []string{"patchBuilding", "staging"},
|
||||||
Key: gui.getKey("universal.nextBlock-alt"),
|
Key: gui.getKey("universal.nextBlock-alt"),
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleSelectNextHunk,
|
Handler: gui.handleSelectNextHunk,
|
||||||
@ -1096,14 +1096,14 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patch-building"},
|
Contexts: []string{"patchBuilding"},
|
||||||
Key: gui.getKey("universal.select"),
|
Key: gui.getKey("universal.select"),
|
||||||
Handler: gui.handleToggleSelectionForPatch,
|
Handler: gui.handleToggleSelectionForPatch,
|
||||||
Description: gui.Tr.SLocalize("ToggleSelectionForPatch"),
|
Description: gui.Tr.SLocalize("ToggleSelectionForPatch"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patch-building", "staging"},
|
Contexts: []string{"patchBuilding", "staging"},
|
||||||
Key: gui.getKey("main.toggleDragSelect"),
|
Key: gui.getKey("main.toggleDragSelect"),
|
||||||
Handler: gui.handleToggleSelectRange,
|
Handler: gui.handleToggleSelectRange,
|
||||||
Description: gui.Tr.SLocalize("ToggleDragSelect"),
|
Description: gui.Tr.SLocalize("ToggleDragSelect"),
|
||||||
@ -1111,42 +1111,42 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
|||||||
// Alias 'V' -> 'v'
|
// Alias 'V' -> 'v'
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patch-building", "staging"},
|
Contexts: []string{"patchBuilding", "staging"},
|
||||||
Key: gui.getKey("main.toggleDragSelect-alt"),
|
Key: gui.getKey("main.toggleDragSelect-alt"),
|
||||||
Handler: gui.handleToggleSelectRange,
|
Handler: gui.handleToggleSelectRange,
|
||||||
Description: gui.Tr.SLocalize("ToggleDragSelect"),
|
Description: gui.Tr.SLocalize("ToggleDragSelect"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patch-building", "staging"},
|
Contexts: []string{"patchBuilding", "staging"},
|
||||||
Key: gui.getKey("main.toggleSelectHunk"),
|
Key: gui.getKey("main.toggleSelectHunk"),
|
||||||
Handler: gui.handleToggleSelectHunk,
|
Handler: gui.handleToggleSelectHunk,
|
||||||
Description: gui.Tr.SLocalize("ToggleSelectHunk"),
|
Description: gui.Tr.SLocalize("ToggleSelectHunk"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patch-building", "staging"},
|
Contexts: []string{"patchBuilding", "staging"},
|
||||||
Key: gocui.MouseLeft,
|
Key: gocui.MouseLeft,
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleMouseDown,
|
Handler: gui.handleMouseDown,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patch-building", "staging"},
|
Contexts: []string{"patchBuilding", "staging"},
|
||||||
Key: gocui.MouseLeft,
|
Key: gocui.MouseLeft,
|
||||||
Modifier: gocui.ModMotion,
|
Modifier: gocui.ModMotion,
|
||||||
Handler: gui.handleMouseDrag,
|
Handler: gui.handleMouseDrag,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patch-building", "staging"},
|
Contexts: []string{"patchBuilding", "staging"},
|
||||||
Key: gocui.MouseWheelUp,
|
Key: gocui.MouseWheelUp,
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleMouseScrollUp,
|
Handler: gui.handleMouseScrollUp,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "main",
|
ViewName: "main",
|
||||||
Contexts: []string{"patch-building", "staging"},
|
Contexts: []string{"patchBuilding", "staging"},
|
||||||
Key: gocui.MouseWheelDown,
|
Key: gocui.MouseWheelDown,
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleMouseScrollDown,
|
Handler: gui.handleMouseScrollDown,
|
||||||
|
@ -299,7 +299,7 @@ func (gui *Gui) layout(g *gocui.Gui) error {
|
|||||||
{view: commitsView, contextKey: "branch-commits", selectedLine: gui.State.Panels.Commits.SelectedLine, lineCount: len(gui.State.Commits), listContext: gui.branchCommitsListContext()},
|
{view: commitsView, contextKey: "branch-commits", selectedLine: gui.State.Panels.Commits.SelectedLine, lineCount: len(gui.State.Commits), listContext: gui.branchCommitsListContext()},
|
||||||
{view: commitsView, contextKey: "reflog-commits", selectedLine: gui.State.Panels.ReflogCommits.SelectedLine, lineCount: len(gui.State.FilteredReflogCommits), listContext: gui.reflogCommitsListContext()},
|
{view: commitsView, contextKey: "reflog-commits", selectedLine: gui.State.Panels.ReflogCommits.SelectedLine, lineCount: len(gui.State.FilteredReflogCommits), listContext: gui.reflogCommitsListContext()},
|
||||||
{view: stashView, contextKey: "stash", selectedLine: gui.State.Panels.Stash.SelectedLine, lineCount: len(gui.State.StashEntries), listContext: gui.stashListContext()},
|
{view: stashView, contextKey: "stash", selectedLine: gui.State.Panels.Stash.SelectedLine, lineCount: len(gui.State.StashEntries), listContext: gui.stashListContext()},
|
||||||
{view: commitFilesView, contextKey: "commit-files", selectedLine: gui.State.Panels.CommitFiles.SelectedLine, lineCount: len(gui.State.CommitFiles), listContext: gui.commitFilesListContext()},
|
{view: commitFilesView, contextKey: "commitFiles", selectedLine: gui.State.Panels.CommitFiles.SelectedLine, lineCount: len(gui.State.CommitFiles), listContext: gui.commitFilesListContext()},
|
||||||
}
|
}
|
||||||
|
|
||||||
// menu view might not exist so we check to be safe
|
// menu view might not exist so we check to be safe
|
||||||
|
@ -332,7 +332,7 @@ func (gui *Gui) handleOpenFileAtLine() error {
|
|||||||
// again, would be good to use inheritance here (or maybe even composition)
|
// again, would be good to use inheritance here (or maybe even composition)
|
||||||
var filename string
|
var filename string
|
||||||
switch gui.State.MainContext {
|
switch gui.State.MainContext {
|
||||||
case "patch-building":
|
case "patchBuilding":
|
||||||
filename = gui.getSelectedCommitFileName()
|
filename = gui.getSelectedCommitFileName()
|
||||||
case "staging":
|
case "staging":
|
||||||
file := gui.getSelectedFile()
|
file := gui.getSelectedFile()
|
||||||
|
@ -326,7 +326,7 @@ func (gui *Gui) stashListContext() *ListContext {
|
|||||||
func (gui *Gui) commitFilesListContext() *ListContext {
|
func (gui *Gui) commitFilesListContext() *ListContext {
|
||||||
return &ListContext{
|
return &ListContext{
|
||||||
ViewName: "commitFiles",
|
ViewName: "commitFiles",
|
||||||
ContextKey: "commit-files",
|
ContextKey: "commitFiles",
|
||||||
GetItemsLength: func() int { return len(gui.State.CommitFiles) },
|
GetItemsLength: func() int { return len(gui.State.CommitFiles) },
|
||||||
GetSelectedLineIdxPtr: func() *int { return &gui.State.Panels.CommitFiles.SelectedLine },
|
GetSelectedLineIdxPtr: func() *int { return &gui.State.Panels.CommitFiles.SelectedLine },
|
||||||
OnFocus: gui.handleCommitFileSelect,
|
OnFocus: gui.handleCommitFileSelect,
|
||||||
|
@ -77,7 +77,7 @@ func (gui *Gui) validateNormalWorkingTreeState() (bool, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (gui *Gui) returnFocusFromLineByLinePanelIfNecessary() error {
|
func (gui *Gui) returnFocusFromLineByLinePanelIfNecessary() error {
|
||||||
if gui.State.MainContext == "patch-building" {
|
if gui.State.MainContext == "patchBuilding" {
|
||||||
return gui.handleEscapePatchBuildingPanel()
|
return gui.handleEscapePatchBuildingPanel()
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
Reference in New Issue
Block a user