1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-24 05:36:19 +02:00

use camelCase

This commit is contained in:
Jesse Duffield 2020-08-19 22:59:35 +10:00
parent 7561f5aa32
commit bc410d8e4a
7 changed files with 27 additions and 27 deletions

View File

@ -191,7 +191,7 @@ func (gui *Gui) contextTree() ContextTree {
},
Kind: MAIN_CONTEXT,
ViewName: "main",
Key: "patch-building",
Key: "patchBuilding",
},
},
Merging: SimpleContextNode{
@ -526,7 +526,7 @@ func (gui *Gui) changeMainViewsContext(context string) {
}
switch context {
case "normal", "patch-building", "staging", "merging":
case "normal", "patchBuilding", "staging", "merging":
gui.getMainView().Context = context
gui.getSecondaryView().Context = context
default:

View File

@ -44,7 +44,7 @@ func (gui *Gui) currentDiffTerminals() []string {
switch gui.currentContextKey() {
case "files":
// not supporting files for now
case "commit-files":
case "commitFiles":
// not supporting commit files for now
case "branch-commits":
item := gui.getSelectedCommit()

View File

@ -998,84 +998,84 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
},
{
ViewName: "main",
Contexts: []string{"patch-building"},
Contexts: []string{"patchBuilding"},
Key: gui.getKey("universal.return"),
Handler: gui.wrappedHandler(gui.handleEscapePatchBuildingPanel),
Description: gui.Tr.SLocalize("ExitLineByLineMode"),
},
{
ViewName: "main",
Contexts: []string{"patch-building", "staging"},
Contexts: []string{"patchBuilding", "staging"},
Key: gui.getKey("universal.openFile"),
Handler: gui.wrappedHandler(gui.handleOpenFileAtLine),
Description: gui.Tr.SLocalize("openFile"),
},
{
ViewName: "main",
Contexts: []string{"patch-building", "staging"},
Contexts: []string{"patchBuilding", "staging"},
Key: gui.getKey("universal.prevItem"),
Handler: gui.handleSelectPrevLine,
Description: gui.Tr.SLocalize("PrevLine"),
},
{
ViewName: "main",
Contexts: []string{"patch-building", "staging"},
Contexts: []string{"patchBuilding", "staging"},
Key: gui.getKey("universal.nextItem"),
Handler: gui.handleSelectNextLine,
Description: gui.Tr.SLocalize("NextLine"),
},
{
ViewName: "main",
Contexts: []string{"patch-building", "staging"},
Contexts: []string{"patchBuilding", "staging"},
Key: gui.getKey("universal.prevItem-alt"),
Modifier: gocui.ModNone,
Handler: gui.handleSelectPrevLine,
},
{
ViewName: "main",
Contexts: []string{"patch-building", "staging"},
Contexts: []string{"patchBuilding", "staging"},
Key: gui.getKey("universal.nextItem-alt"),
Modifier: gocui.ModNone,
Handler: gui.handleSelectNextLine,
},
{
ViewName: "main",
Contexts: []string{"patch-building", "staging"},
Contexts: []string{"patchBuilding", "staging"},
Key: gocui.MouseWheelUp,
Modifier: gocui.ModNone,
Handler: gui.handleSelectPrevLine,
},
{
ViewName: "main",
Contexts: []string{"patch-building", "staging"},
Contexts: []string{"patchBuilding", "staging"},
Key: gocui.MouseWheelDown,
Modifier: gocui.ModNone,
Handler: gui.handleSelectNextLine,
},
{
ViewName: "main",
Contexts: []string{"patch-building", "staging"},
Contexts: []string{"patchBuilding", "staging"},
Key: gui.getKey("universal.prevBlock"),
Handler: gui.handleSelectPrevHunk,
Description: gui.Tr.SLocalize("PrevHunk"),
},
{
ViewName: "main",
Contexts: []string{"patch-building", "staging"},
Contexts: []string{"patchBuilding", "staging"},
Key: gui.getKey("universal.nextBlock"),
Handler: gui.handleSelectNextHunk,
Description: gui.Tr.SLocalize("NextHunk"),
},
{
ViewName: "main",
Contexts: []string{"patch-building", "staging"},
Contexts: []string{"patchBuilding", "staging"},
Key: gui.getKey("universal.prevBlock-alt"),
Modifier: gocui.ModNone,
Handler: gui.handleSelectPrevHunk,
},
{
ViewName: "main",
Contexts: []string{"patch-building", "staging"},
Contexts: []string{"patchBuilding", "staging"},
Key: gui.getKey("universal.nextBlock-alt"),
Modifier: gocui.ModNone,
Handler: gui.handleSelectNextHunk,
@ -1096,14 +1096,14 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
},
{
ViewName: "main",
Contexts: []string{"patch-building"},
Contexts: []string{"patchBuilding"},
Key: gui.getKey("universal.select"),
Handler: gui.handleToggleSelectionForPatch,
Description: gui.Tr.SLocalize("ToggleSelectionForPatch"),
},
{
ViewName: "main",
Contexts: []string{"patch-building", "staging"},
Contexts: []string{"patchBuilding", "staging"},
Key: gui.getKey("main.toggleDragSelect"),
Handler: gui.handleToggleSelectRange,
Description: gui.Tr.SLocalize("ToggleDragSelect"),
@ -1111,42 +1111,42 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
// Alias 'V' -> 'v'
{
ViewName: "main",
Contexts: []string{"patch-building", "staging"},
Contexts: []string{"patchBuilding", "staging"},
Key: gui.getKey("main.toggleDragSelect-alt"),
Handler: gui.handleToggleSelectRange,
Description: gui.Tr.SLocalize("ToggleDragSelect"),
},
{
ViewName: "main",
Contexts: []string{"patch-building", "staging"},
Contexts: []string{"patchBuilding", "staging"},
Key: gui.getKey("main.toggleSelectHunk"),
Handler: gui.handleToggleSelectHunk,
Description: gui.Tr.SLocalize("ToggleSelectHunk"),
},
{
ViewName: "main",
Contexts: []string{"patch-building", "staging"},
Contexts: []string{"patchBuilding", "staging"},
Key: gocui.MouseLeft,
Modifier: gocui.ModNone,
Handler: gui.handleMouseDown,
},
{
ViewName: "main",
Contexts: []string{"patch-building", "staging"},
Contexts: []string{"patchBuilding", "staging"},
Key: gocui.MouseLeft,
Modifier: gocui.ModMotion,
Handler: gui.handleMouseDrag,
},
{
ViewName: "main",
Contexts: []string{"patch-building", "staging"},
Contexts: []string{"patchBuilding", "staging"},
Key: gocui.MouseWheelUp,
Modifier: gocui.ModNone,
Handler: gui.handleMouseScrollUp,
},
{
ViewName: "main",
Contexts: []string{"patch-building", "staging"},
Contexts: []string{"patchBuilding", "staging"},
Key: gocui.MouseWheelDown,
Modifier: gocui.ModNone,
Handler: gui.handleMouseScrollDown,

View File

@ -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: "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: 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

View File

@ -332,7 +332,7 @@ func (gui *Gui) handleOpenFileAtLine() error {
// again, would be good to use inheritance here (or maybe even composition)
var filename string
switch gui.State.MainContext {
case "patch-building":
case "patchBuilding":
filename = gui.getSelectedCommitFileName()
case "staging":
file := gui.getSelectedFile()

View File

@ -326,7 +326,7 @@ func (gui *Gui) stashListContext() *ListContext {
func (gui *Gui) commitFilesListContext() *ListContext {
return &ListContext{
ViewName: "commitFiles",
ContextKey: "commit-files",
ContextKey: "commitFiles",
GetItemsLength: func() int { return len(gui.State.CommitFiles) },
GetSelectedLineIdxPtr: func() *int { return &gui.State.Panels.CommitFiles.SelectedLine },
OnFocus: gui.handleCommitFileSelect,

View File

@ -77,7 +77,7 @@ func (gui *Gui) validateNormalWorkingTreeState() (bool, error) {
}
func (gui *Gui) returnFocusFromLineByLinePanelIfNecessary() error {
if gui.State.MainContext == "patch-building" {
if gui.State.MainContext == "patchBuilding" {
return gui.handleEscapePatchBuildingPanel()
}
return nil