Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recorded macro: "SyntaxError: unexpected garbage after function body, starting with '}'" #3935

Open
ogitha opened this issue Jul 20, 2021 · 0 comments

Comments

@ogitha
Copy link

ogitha commented Jul 20, 2021

Short Summary

After recording some key sequences, recorded macros stop working. Any attempt to execute a recorded macro results in a popup saying:

Syntax Error in userscript "(null)".
SyntaxError: unexpected garbage after function body, starting with '}'
line: 4

Steps to Reproduce

Edit Preferences, and assign key F5 to Start Recording and F7 to Execute Last Macro.
Copy a short piece of text.
Start recording using F5
Press these keys: ctrl-V, shift-left
Stop recording
Play macro using F7

Expected results

The macro runs, pasting the copied piece of text and selecting the last pasted character.

Actual results

The result is an error message "SyntaxError: unexpected garbage after function body, starting with '}'"
Any macro I try to record and play from that moment on will result in the same error.

Platform Information

Komodo Edit or IDE? - both Komodo Edit and Komodo IDE
Komodo Version? - Reproduced now on 12.0.0, but also 10.2.3 and 11.1.0.
Operating System (and version)? - Kubuntu 20.04, Kubuntu 18.04

Additional Information

The only way I found to fix this once it happens is to exit Komodo Edit and start it again.
The error does not occur if I start recording using the toolbar.

When I try to save the recorded macro as a userscript and edit it, I see this:

// Macro recorded on: Wed Jul 21 2021 18:11:09 GMT+0300 (IDT)
komodo.assertMacroVersion(3);
if (komodo.view) { komodo.view.setFocus(); }
ko.commands.doCommand('cmd_paste')
setTimeout(function() {
ko.commands.doCommand('cmd_selectCharPrevious')
}, 100); // cmd_paste is async
}, 100); // cmd_paste is async

The last line seems out of place.

@ogitha ogitha changed the title recorder macro: "SyntaxError: unexpected garbage after function body, starting with '}'" recorded macro: "SyntaxError: unexpected garbage after function body, starting with '}'" Jul 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant