mirror of
https://github.com/jesseduffield/lazygit.git
synced 2024-11-30 09:16:47 +02:00
support commit message via git editor using shift+C keybinding
This commit is contained in:
parent
0ac306fe2a
commit
1419be1aab
@ -12,6 +12,7 @@
|
||||
|
||||
space: toggle staged
|
||||
c: commit changes
|
||||
shift+C: commit using git editor
|
||||
shift+S: stash files
|
||||
t: add patched (i.e. pick chunks of a file to add)
|
||||
o: open
|
||||
@ -47,6 +48,7 @@
|
||||
|
||||
esc: close/cancel
|
||||
enter: confirm
|
||||
tab: enter newline (if editing)
|
||||
|
||||
## Resolving Merge Conflicts (Diff Panel):
|
||||
|
||||
|
@ -186,6 +186,14 @@ func handleCommitPress(g *gocui.Gui, filesView *gocui.View) error {
|
||||
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 {
|
||||
file, err := getSelectedFile(g)
|
||||
if err != nil {
|
||||
|
@ -22,6 +22,7 @@ func keybindings(g *gocui.Gui) error {
|
||||
{ViewName: "", Key: 'p', Modifier: gocui.ModNone, Handler: pullFiles},
|
||||
{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: handleCommitEditorPress},
|
||||
{ViewName: "files", Key: gocui.KeySpace, Modifier: gocui.ModNone, Handler: handleFilePress},
|
||||
{ViewName: "files", Key: 'd', Modifier: gocui.ModNone, Handler: handleFileRemove},
|
||||
{ViewName: "files", Key: 'm', Modifier: gocui.ModNone, Handler: handleSwitchToMerge},
|
||||
|
Loading…
Reference in New Issue
Block a user