mirror of
https://github.com/EnumeratedDev/typer.git
synced 2026-09-16 05:36:10 +00:00
Add accepted cursor modes to key bindings
This commit is contained in:
+4
-6
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user