return error rather than truncate steps in validation

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Andrew Davis 2025-04-02 09:14:22 +10:00 committed by GitHub
parent 2766f50dce
commit 7cac28926a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -61,7 +61,7 @@ func (m *KeyboardMacro) Validate() error {
} }
if len(m.Steps) > MaxStepsPerMacro { if len(m.Steps) > MaxStepsPerMacro {
m.Steps = m.Steps[:MaxStepsPerMacro] return fmt.Errorf("too many steps in macro (max %d)", MaxStepsPerMacro)
} }
for i := range m.Steps { for i := range m.Steps {