1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-11-24 08:52:21 +02:00

Showing modal when no files to commit

This commit is contained in:
Jesse Duffield 2018-05-26 17:18:00 +10:00
parent 843927dd26
commit 787e5d13ed

View File

@ -15,7 +15,7 @@ import (
func handleCommitPress(g *gocui.Gui, currentView *gocui.View) error {
devLog(stagedFiles(state.GitFiles))
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()
if v, err := g.SetView("commit", maxX/2-30, maxY/2-1, maxX/2+30, maxY/2+1); err != nil {