mirror of
				https://github.com/jesseduffield/lazygit.git
				synced 2025-10-30 23:57:43 +02:00 
			
		
		
		
	Merge pull request #2495 from jesseduffield/feature/remove-altreturn
This commit is contained in:
		| @@ -116,8 +116,6 @@ keybinding: | ||||
|     quit: 'q' | ||||
|     quit-alt1: '<c-c>' # alternative/alias of quit | ||||
|     return: '<esc>' # return to previous menu, will quit if there's nowhere to return | ||||
|     # When set to a printable character, this will work for returning from non-prompt panels | ||||
|     return-alt1: null | ||||
|     quitWithoutChangingDirectory: 'Q' | ||||
|     togglePanel: '<tab>' # goto the next panel | ||||
|     prevItem: '<up>' # go one line up | ||||
| @@ -143,7 +141,6 @@ keybinding: | ||||
|     goInto: '<enter>' | ||||
|     openRecentRepos: '<c-r>' | ||||
|     confirm: '<enter>' | ||||
|     confirm-alt1: 'y' | ||||
|     remove: 'd' | ||||
|     new: 'n' | ||||
|     edit: 'e' | ||||
|   | ||||
| @@ -138,7 +138,6 @@ type KeybindingUniversalConfig struct { | ||||
| 	Quit                         string   `yaml:"quit"` | ||||
| 	QuitAlt1                     string   `yaml:"quit-alt1"` | ||||
| 	Return                       string   `yaml:"return"` | ||||
| 	ReturnAlt1                   string   `yaml:"return-alt1"` | ||||
| 	QuitWithoutChangingDirectory string   `yaml:"quitWithoutChangingDirectory"` | ||||
| 	TogglePanel                  string   `yaml:"togglePanel"` | ||||
| 	PrevItem                     string   `yaml:"prevItem"` | ||||
| @@ -166,7 +165,6 @@ type KeybindingUniversalConfig struct { | ||||
| 	Select                       string   `yaml:"select"` | ||||
| 	GoInto                       string   `yaml:"goInto"` | ||||
| 	Confirm                      string   `yaml:"confirm"` | ||||
| 	ConfirmAlt1                  string   `yaml:"confirm-alt1"` | ||||
| 	Remove                       string   `yaml:"remove"` | ||||
| 	New                          string   `yaml:"new"` | ||||
| 	Edit                         string   `yaml:"edit"` | ||||
| @@ -429,7 +427,6 @@ func GetDefaultConfig() *UserConfig { | ||||
| 				Quit:                         "q", | ||||
| 				QuitAlt1:                     "<c-c>", | ||||
| 				Return:                       "<esc>", | ||||
| 				ReturnAlt1:                   "", | ||||
| 				QuitWithoutChangingDirectory: "Q", | ||||
| 				TogglePanel:                  "<tab>", | ||||
| 				PrevItem:                     "<up>", | ||||
| @@ -457,7 +454,6 @@ func GetDefaultConfig() *UserConfig { | ||||
| 				Select:                       "<space>", | ||||
| 				GoInto:                       "<enter>", | ||||
| 				Confirm:                      "<enter>", | ||||
| 				ConfirmAlt1:                  "y", | ||||
| 				Remove:                       "d", | ||||
| 				New:                          "n", | ||||
| 				Edit:                         "e", | ||||
|   | ||||
| @@ -241,21 +241,11 @@ func (gui *Gui) setKeyBindings(cancel context.CancelFunc, opts types.CreatePopup | ||||
| 			Key:      keybindings.GetKey(keybindingConfig.Universal.Confirm), | ||||
| 			Handler:  onConfirm, | ||||
| 		}, | ||||
| 		{ | ||||
| 			ViewName: "confirmation", | ||||
| 			Key:      keybindings.GetKey(keybindingConfig.Universal.ConfirmAlt1), | ||||
| 			Handler:  onConfirm, | ||||
| 		}, | ||||
| 		{ | ||||
| 			ViewName: "confirmation", | ||||
| 			Key:      keybindings.GetKey(keybindingConfig.Universal.Return), | ||||
| 			Handler:  gui.wrappedConfirmationFunction(cancel, opts.HandleClose), | ||||
| 		}, | ||||
| 		{ | ||||
| 			ViewName: "confirmation", | ||||
| 			Key:      keybindings.GetKey(keybindingConfig.Universal.ReturnAlt1), | ||||
| 			Handler:  gui.wrappedConfirmationFunction(cancel, opts.HandleClose), | ||||
| 		}, | ||||
| 		{ | ||||
| 			ViewName: "confirmation", | ||||
| 			Key:      keybindings.GetKey(keybindingConfig.Universal.TogglePanel), | ||||
| @@ -271,21 +261,11 @@ func (gui *Gui) setKeyBindings(cancel context.CancelFunc, opts types.CreatePopup | ||||
| 			Key:      keybindings.GetKey(keybindingConfig.Universal.Confirm), | ||||
| 			Handler:  onSuggestionConfirm, | ||||
| 		}, | ||||
| 		{ | ||||
| 			ViewName: "suggestions", | ||||
| 			Key:      keybindings.GetKey(keybindingConfig.Universal.ConfirmAlt1), | ||||
| 			Handler:  onSuggestionConfirm, | ||||
| 		}, | ||||
| 		{ | ||||
| 			ViewName: "suggestions", | ||||
| 			Key:      keybindings.GetKey(keybindingConfig.Universal.Return), | ||||
| 			Handler:  gui.wrappedConfirmationFunction(cancel, opts.HandleClose), | ||||
| 		}, | ||||
| 		{ | ||||
| 			ViewName: "suggestions", | ||||
| 			Key:      keybindings.GetKey(keybindingConfig.Universal.ReturnAlt1), | ||||
| 			Handler:  gui.wrappedConfirmationFunction(cancel, opts.HandleClose), | ||||
| 		}, | ||||
| 		{ | ||||
| 			ViewName: "suggestions", | ||||
| 			Key:      keybindings.GetKey(keybindingConfig.Universal.TogglePanel), | ||||
| @@ -305,13 +285,9 @@ func (gui *Gui) setKeyBindings(cancel context.CancelFunc, opts types.CreatePopup | ||||
| func (gui *Gui) clearConfirmationViewKeyBindings() { | ||||
| 	keybindingConfig := gui.c.UserConfig.Keybinding | ||||
| 	_ = gui.g.DeleteKeybinding("confirmation", keybindings.GetKey(keybindingConfig.Universal.Confirm), gocui.ModNone) | ||||
| 	_ = gui.g.DeleteKeybinding("confirmation", keybindings.GetKey(keybindingConfig.Universal.ConfirmAlt1), gocui.ModNone) | ||||
| 	_ = gui.g.DeleteKeybinding("confirmation", keybindings.GetKey(keybindingConfig.Universal.Return), gocui.ModNone) | ||||
| 	_ = gui.g.DeleteKeybinding("confirmation", keybindings.GetKey(keybindingConfig.Universal.ReturnAlt1), gocui.ModNone) | ||||
| 	_ = gui.g.DeleteKeybinding("suggestions", keybindings.GetKey(keybindingConfig.Universal.Confirm), gocui.ModNone) | ||||
| 	_ = gui.g.DeleteKeybinding("suggestions", keybindings.GetKey(keybindingConfig.Universal.ConfirmAlt1), gocui.ModNone) | ||||
| 	_ = gui.g.DeleteKeybinding("suggestions", keybindings.GetKey(keybindingConfig.Universal.Return), gocui.ModNone) | ||||
| 	_ = gui.g.DeleteKeybinding("suggestions", keybindings.GetKey(keybindingConfig.Universal.ReturnAlt1), gocui.ModNone) | ||||
| } | ||||
|  | ||||
| func (gui *Gui) refreshSuggestions() { | ||||
|   | ||||
| @@ -41,10 +41,6 @@ func (self *CommitMessageController) GetKeybindings(opts types.KeybindingsOpts) | ||||
| 			Key:     opts.GetKey(opts.Config.Universal.Return), | ||||
| 			Handler: self.close, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:     opts.GetKey(opts.Config.Universal.ReturnAlt1), | ||||
| 			Handler: self.close, | ||||
| 		}, | ||||
| 	} | ||||
|  | ||||
| 	return bindings | ||||
|   | ||||
| @@ -31,18 +31,10 @@ func (self *MenuController) GetKeybindings(opts types.KeybindingsOpts) []*types. | ||||
| 			Key:     opts.GetKey(opts.Config.Universal.Confirm), | ||||
| 			Handler: self.press, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:     opts.GetKey(opts.Config.Universal.ConfirmAlt1), | ||||
| 			Handler: self.press, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:     opts.GetKey(opts.Config.Universal.Return), | ||||
| 			Handler: self.close, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:     opts.GetKey(opts.Config.Universal.ReturnAlt1), | ||||
| 			Handler: self.close, | ||||
| 		}, | ||||
| 	} | ||||
|  | ||||
| 	return bindings | ||||
|   | ||||
| @@ -110,11 +110,6 @@ func (self *MergeConflictsController) GetKeybindings(opts types.KeybindingsOpts) | ||||
| 			Handler:     self.Escape, | ||||
| 			Description: self.c.Tr.ReturnToFilesPanel, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Universal.ReturnAlt1), | ||||
| 			Handler:     self.Escape, | ||||
| 			Description: self.c.Tr.ReturnToFilesPanel, | ||||
| 		}, | ||||
| 	} | ||||
|  | ||||
| 	return bindings | ||||
|   | ||||
| @@ -44,11 +44,6 @@ func (self *PatchBuildingController) GetKeybindings(opts types.KeybindingsOpts) | ||||
| 			Handler:     self.Escape, | ||||
| 			Description: self.c.Tr.ExitCustomPatchBuilder, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Universal.ReturnAlt1), | ||||
| 			Handler:     self.Escape, | ||||
| 			Description: self.c.Tr.ExitCustomPatchBuilder, | ||||
| 		}, | ||||
| 	} | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -64,11 +64,6 @@ func (self *RemoteBranchesController) GetKeybindings(opts types.KeybindingsOpts) | ||||
| 			Handler:     self.escape, | ||||
| 			Description: self.c.Tr.ReturnToRemotesList, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Universal.ReturnAlt1), | ||||
| 			Handler:     self.escape, | ||||
| 			Description: self.c.Tr.ReturnToRemotesList, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Commits.ViewResetOptions), | ||||
| 			Handler:     self.checkSelected(self.createResetMenu), | ||||
|   | ||||
| @@ -47,10 +47,6 @@ func (self *SnakeController) GetKeybindings(opts types.KeybindingsOpts) []*types | ||||
| 			Key:     opts.GetKey(opts.Config.Universal.Return), | ||||
| 			Handler: self.Escape, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:     opts.GetKey(opts.Config.Universal.ReturnAlt1), | ||||
| 			Handler: self.Escape, | ||||
| 		}, | ||||
| 	} | ||||
|  | ||||
| 	return bindings | ||||
|   | ||||
| @@ -53,11 +53,6 @@ func (self *StagingController) GetKeybindings(opts types.KeybindingsOpts) []*typ | ||||
| 			Handler:     self.Escape, | ||||
| 			Description: self.c.Tr.ReturnToFilesPanel, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Universal.ReturnAlt1), | ||||
| 			Handler:     self.Escape, | ||||
| 			Description: self.c.Tr.ReturnToFilesPanel, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Universal.TogglePanel), | ||||
| 			Handler:     self.TogglePanel, | ||||
|   | ||||
| @@ -74,12 +74,6 @@ func (self *Gui) GetInitialKeybindings() ([]*types.Binding, []*gocui.ViewMouseBi | ||||
| 			Modifier: gocui.ModNone, | ||||
| 			Handler:  self.handleTopLevelReturn, | ||||
| 		}, | ||||
| 		{ | ||||
| 			ViewName: "", | ||||
| 			Key:      opts.GetKey(opts.Config.Universal.ReturnAlt1), | ||||
| 			Modifier: gocui.ModNone, | ||||
| 			Handler:  self.handleTopLevelReturn, | ||||
| 		}, | ||||
| 		{ | ||||
| 			ViewName:    "", | ||||
| 			Key:         opts.GetKey(opts.Config.Universal.OpenRecentRepos), | ||||
| @@ -333,12 +327,6 @@ func (self *Gui) GetInitialKeybindings() ([]*types.Binding, []*gocui.ViewMouseBi | ||||
| 			Modifier: gocui.ModNone, | ||||
| 			Handler:  self.handleSearchEscape, | ||||
| 		}, | ||||
| 		{ | ||||
| 			ViewName: "search", | ||||
| 			Key:      opts.GetKey(opts.Config.Universal.ReturnAlt1), | ||||
| 			Modifier: gocui.ModNone, | ||||
| 			Handler:  self.handleSearchEscape, | ||||
| 		}, | ||||
| 		{ | ||||
| 			ViewName: "confirmation", | ||||
| 			Key:      opts.GetKey(opts.Config.Universal.PrevItem), | ||||
|   | ||||
		Reference in New Issue
	
	Block a user