mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 07:36:27 -04:00
Remove unused function DeleteKeybinding
I noticed that it compares key.keyName and key.str separately instead of calling key.Equals, but instead of deciding whether that's a problem, just delete the function when nobody needs it.
This commit is contained in:
parent
6ed87bd5e4
commit
1bce7ed1c7
|
|
@ -555,17 +555,6 @@ func (g *Gui) SetKeybinding(viewname string, key Key, mod Modifier, handler func
|
|||
return nil
|
||||
}
|
||||
|
||||
// DeleteKeybinding deletes a keybinding.
|
||||
func (g *Gui) DeleteKeybinding(viewname string, key Key, mod Modifier) error {
|
||||
for i, kb := range g.keybindings {
|
||||
if kb.viewName == viewname && kb.key.keyName == key.KeyName() && kb.key.str == key.str && kb.mod == mod {
|
||||
g.keybindings = append(g.keybindings[:i], g.keybindings[i+1:]...)
|
||||
return nil
|
||||
}
|
||||
}
|
||||
return errors.New("keybinding not found")
|
||||
}
|
||||
|
||||
// DeleteKeybindings deletes all keybindings of view.
|
||||
func (g *Gui) DeleteAllKeybindings() {
|
||||
g.keybindings = []*keybinding{}
|
||||
|
|
|
|||
Loading…
Reference in a new issue