mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-03 00:57:52 +02:00
support commit message via git editor using shift+C keybinding
This commit is contained in:
@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
space: toggle staged
|
space: toggle staged
|
||||||
c: commit changes
|
c: commit changes
|
||||||
|
shift+C: commit using git editor
|
||||||
shift+S: stash files
|
shift+S: stash files
|
||||||
t: add patched (i.e. pick chunks of a file to add)
|
t: add patched (i.e. pick chunks of a file to add)
|
||||||
o: open
|
o: open
|
||||||
@ -47,6 +48,7 @@
|
|||||||
|
|
||||||
esc: close/cancel
|
esc: close/cancel
|
||||||
enter: confirm
|
enter: confirm
|
||||||
|
tab: enter newline (if editing)
|
||||||
|
|
||||||
## Resolving Merge Conflicts (Diff Panel):
|
## Resolving Merge Conflicts (Diff Panel):
|
||||||
|
|
||||||
|
@ -186,6 +186,14 @@ func handleCommitPress(g *gocui.Gui, filesView *gocui.View) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func handleCommitEditorPress(g *gocui.Gui, filesView *gocui.View) error {
|
||||||
|
if len(stagedFiles(state.GitFiles)) == 0 && !state.HasMergeConflicts {
|
||||||
|
return createErrorPanel(g, "There are no staged files to commit")
|
||||||
|
}
|
||||||
|
runSubProcess(g, "git", "commit")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func genericFileOpen(g *gocui.Gui, v *gocui.View, open func(*gocui.Gui, string) (string, error)) error {
|
func genericFileOpen(g *gocui.Gui, v *gocui.View, open func(*gocui.Gui, string) (string, error)) error {
|
||||||
file, err := getSelectedFile(g)
|
file, err := getSelectedFile(g)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -22,6 +22,7 @@ func keybindings(g *gocui.Gui) error {
|
|||||||
{ViewName: "", Key: 'p', Modifier: gocui.ModNone, Handler: pullFiles},
|
{ViewName: "", Key: 'p', Modifier: gocui.ModNone, Handler: pullFiles},
|
||||||
{ViewName: "", Key: 'R', Modifier: gocui.ModNone, Handler: handleRefresh},
|
{ViewName: "", Key: 'R', Modifier: gocui.ModNone, Handler: handleRefresh},
|
||||||
{ViewName: "files", Key: 'c', Modifier: gocui.ModNone, Handler: handleCommitPress},
|
{ViewName: "files", Key: 'c', Modifier: gocui.ModNone, Handler: handleCommitPress},
|
||||||
|
{ViewName: "files", Key: 'C', Modifier: gocui.ModNone, Handler: handleCommitEditorPress},
|
||||||
{ViewName: "files", Key: gocui.KeySpace, Modifier: gocui.ModNone, Handler: handleFilePress},
|
{ViewName: "files", Key: gocui.KeySpace, Modifier: gocui.ModNone, Handler: handleFilePress},
|
||||||
{ViewName: "files", Key: 'd', Modifier: gocui.ModNone, Handler: handleFileRemove},
|
{ViewName: "files", Key: 'd', Modifier: gocui.ModNone, Handler: handleFileRemove},
|
||||||
{ViewName: "files", Key: 'm', Modifier: gocui.ModNone, Handler: handleSwitchToMerge},
|
{ViewName: "files", Key: 'm', Modifier: gocui.ModNone, Handler: handleSwitchToMerge},
|
||||||
|
Reference in New Issue
Block a user