Add accepted cursor modes to key bindings

This commit is contained in:
2025-06-10 20:52:41 +03:00
parent df6d96234a
commit 4ca6d9b75b
2 changed files with 49 additions and 36 deletions
+4 -6
View File
@@ -332,12 +332,10 @@ func (window *Window) input(ev *tcell.EventKey) {
}
// Check key bindings
if window.CursorMode == CursorModeBuffer {
for _, keybinding := range Keybinds {
if keybinding.IsPressed(ev) {
RunCommand(window, keybinding.command)
return
}
for _, keybinding := range Keybinds {
if keybinding.IsPressed(ev) && slices.Index(keybinding.cursorModes, window.CursorMode) != -1 {
RunCommand(window, keybinding.command)
return
}
}