ryuta46 / vscode-multi-command

Visual Studio Code Plugin named multi-command
MIT License
229 stars 14 forks source link

Enhancement request: create ability to indicate how many times to execute a command #58

Closed mmcintyre123 closed 2 years ago

mmcintyre123 commented 2 years ago

Take for instance the following multicommand:

        {
            "command": "multiCommand.scrollDown5Lines",
            "sequence": [
                "scrollLineDown",
                "scrollLineDown",
                "scrollLineDown",
                "scrollLineDown",
                "scrollLineDown",
                "cursorDown",
                "cursorDown",
                "cursorDown",
                "cursorDown",
                "cursorDown"
            ]
        },

It would be very useful if it were possible to indicate how many times to execute a command. Perhaps like so:

        {
            "command": "multiCommand.scrollDown5Lines",
            "sequence": [
                {"command": "scrollLineDown","executionCount": 5}
                {"command": "cursorDown","executionCount": 5}
            ]
        },

This would also allow for greater flexibility while using a custom sleep command. For example:


        {
            "command": "multiCommand.stopApp",
            "sequence": [
                "extension.liveServer.goOffline",
                {"command": "multiCommand.sleepOneSecond","executionCount": 2} // sleep 2 seconds
                "server.stop",
                {"command": "multiCommand.sleepOneSecond","executionCount": 4} // sleep 4 seconds
                "workbench.action.debug.stop",
                "multiCommand.sleepOneSecond",
                {
                    "command": "extension.keyboard_shortcut_eval",
                    "args": { "javascript": "vscode.window.showInformationMessage('Done!');" }
                },                
            ]
        },

        {
            "command": "multiCommand.sleepOneSecond",
            "interval": 1000,
            "sequence": [
                "workbench.action.focusActiveEditorGroup"
            ]
        },
ryuta46 commented 2 years ago

Implemented in 1.6.0. See Repeat commands in README.

Please reopen this issue or create new issue if you have any problem about this feature. Thanks.