hluk / copyq-commands

Useful commands for CopyQ clipboard manager.
328 stars 72 forks source link

Global/snippets.ini Doesn't Work With Index 0 #56

Closed styper closed 2 years ago

styper commented 2 years ago

Found a bug on snippets.ini where when you select the first snippet it doesn't pastes and throws no error.

Looking into the source it's the "|| abort()" on line 64, it activates the abort because the zero index evaluates to false.

Since dialog() returns "undefined" when cancelling the dialog, the snippet var should be evaluated as:

if (typeof snippet === "undefined") abort()

hluk commented 2 years ago

Fixed. Thanks for the report and details!