Skip to content

Commit

Permalink
keybinds: fix faulty validation messages
Browse files Browse the repository at this point in the history
  • Loading branch information
abenz1267 committed Dec 22, 2024
1 parent 2790fb7 commit d6cdec9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.11.1-git
0.11.1
8 changes: 4 additions & 4 deletions internal/ui/keybinds.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ func (keybinds) validate(bind string) {

for _, v := range fields {
if len(v) > 1 {
_, exists := modifiers[v]
_, exists = specialKeys[v]
_, existsMod := modifiers[v]
_, existsSpecial := specialKeys[v]

if !exists {
if !existsMod && !existsSpecial {
slog.Error("invalid keybind", bind, "key", v)
}
}
Expand All @@ -178,7 +178,7 @@ func (keybinds) validateTriggerLabels(bind string) {
fields := strings.Fields(bind)
_, exists := modifiersInt[fields[0]]

if !exists || len(fields[0]) != 1 {
if !exists || len(fields[0]) == 1 {
slog.Error("invalid trigger_label keybind", bind)
}
}
Expand Down

0 comments on commit d6cdec9

Please sign in to comment.