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:
Stefan Haller 2026-05-05 18:25:16 +02:00
parent 6ed87bd5e4
commit 1bce7ed1c7

View file

@ -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{}