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

Optimize input sequence in playback command #195

Merged
merged 3 commits into from
Jan 13, 2023
Merged

Optimize input sequence in playback command #195

merged 3 commits into from
Jan 13, 2023

Conversation

tshino
Copy link
Owner

@tshino tshino commented Jan 13, 2023

This PR is related to #176.

This PR adds optimization of the input sequence to the playback command.
For example, two consecutive '$type' commands will be concatenated into one and executed and recorded as one command.
This:

await vscode.commands.executeCommand(
    'kb-macro.playback',
    {
        sequence: [
            { command: '$type', args: { text: 'A' } },
            { command: '$type', args: { text: 'B' } }
        ]
    }
);

will be interpreted as:

await vscode.commands.executeCommand(
    'kb-macro.playback',
    {
        sequence: [
            { command: '$type', args: { text: 'AB' } }
        ]
    }
);

This optimization can improve playback performance, especially in a sequence containing a long typing.

@tshino tshino merged commit 3297c2f into main Jan 13, 2023
@tshino tshino deleted the playback-optimize branch January 13, 2023 18:14
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

Successfully merging this pull request may close these issues.

1 participant