mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-17 01:42:45 +02:00
Showing modal when no files to commit
This commit is contained in:
@ -15,7 +15,7 @@ import (
|
|||||||
func handleCommitPress(g *gocui.Gui, currentView *gocui.View) error {
|
func handleCommitPress(g *gocui.Gui, currentView *gocui.View) error {
|
||||||
devLog(stagedFiles(state.GitFiles))
|
devLog(stagedFiles(state.GitFiles))
|
||||||
if len(stagedFiles(state.GitFiles)) == 0 {
|
if len(stagedFiles(state.GitFiles)) == 0 {
|
||||||
return nil
|
return createConfirmationPanel(g, currentView, "Nothing to Commit", "There are no staged files to commit (enter)", nil, nil)
|
||||||
}
|
}
|
||||||
maxX, maxY := g.Size()
|
maxX, maxY := g.Size()
|
||||||
if v, err := g.SetView("commit", maxX/2-30, maxY/2-1, maxX/2+30, maxY/2+1); err != nil {
|
if v, err := g.SetView("commit", maxX/2-30, maxY/2-1, maxX/2+30, maxY/2+1); err != nil {
|
||||||
|
Reference in New Issue
Block a user