mirror of
				https://github.com/jesseduffield/lazygit.git
				synced 2025-10-30 23:57:43 +02:00 
			
		
		
		
	add confirmOnQuit config option
This commit is contained in:
		| @@ -20,6 +20,7 @@ | ||||
|     method: prompt # can be: prompt | background | never | ||||
|     days: 14 # how often an update is checked for | ||||
|   reporting: 'undetermined' # one of: 'on' | 'off' | 'undetermined' | ||||
|   confirmOnQuit: false | ||||
| ``` | ||||
|  | ||||
| ## Platform Defaults: | ||||
|   | ||||
| @@ -228,6 +228,7 @@ update: | ||||
|   method: prompt # can be: prompt | background | never | ||||
|   days: 14 # how often a update is checked for | ||||
| reporting: 'undetermined' # one of: 'on' | 'off' | 'undetermined' | ||||
| confirmOnQuit: false | ||||
| `) | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -411,5 +411,10 @@ func (gui *Gui) quit(g *gocui.Gui, v *gocui.View) error { | ||||
| 	if gui.State.Updating { | ||||
| 		return gui.createUpdateQuitConfirmation(g, v) | ||||
| 	} | ||||
| 	if gui.Config.GetUserConfig().GetBool("confirmOnQuit") { | ||||
| 		return gui.createConfirmationPanel(g, v, "", gui.Tr.SLocalize("ConfirmQuit"), func(g *gocui.Gui, v *gocui.View) error { | ||||
| 			return gocui.ErrQuit | ||||
| 		}, nil) | ||||
| 	} | ||||
| 	return gocui.ErrQuit | ||||
| } | ||||
|   | ||||
| @@ -295,6 +295,9 @@ func addDutch(i18nObject *i18n.Bundle) error { | ||||
| 		}, &i18n.Message{ | ||||
| 			ID:    "MergeAborted", | ||||
| 			Other: "Merge afgebroken", | ||||
| 		}, &i18n.Message{ | ||||
| 			ID:    "ConfirmQuit", | ||||
| 			Other: `Are you sure you want to quit?`, | ||||
| 		}, | ||||
| 	) | ||||
| } | ||||
|   | ||||
| @@ -342,6 +342,9 @@ func addEnglish(i18nObject *i18n.Bundle) error { | ||||
| 		}, &i18n.Message{ | ||||
| 			ID:    "GitconfigParseErr", | ||||
| 			Other: `Gogit failed to parse your gitconfig file due to the presence of unquoted '\' characters. Removing these should fix the issue.`, | ||||
| 		}, &i18n.Message{ | ||||
| 			ID:    "ConfirmQuit", | ||||
| 			Other: `Are you sure you want to quit?`, | ||||
| 		}, | ||||
| 	) | ||||
| } | ||||
|   | ||||
| @@ -287,6 +287,9 @@ func addPolish(i18nObject *i18n.Bundle) error { | ||||
| 		}, &i18n.Message{ | ||||
| 			ID:    "MergeAborted", | ||||
| 			Other: "Scalanie anulowane", | ||||
| 		}, &i18n.Message{ | ||||
| 			ID:    "ConfirmQuit", | ||||
| 			Other: `Na pewno chcesz wyjść z programu?`, | ||||
| 		}, | ||||
| 	) | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user