ryuta46 / vscode-multi-command

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

Using 'type' (enter) inside sequence #13

Closed jonasmellquist closed 5 years ago

jonasmellquist commented 5 years ago

VS Code 1.31.1 for Mac multi-command 1.3.0

I'm trying to create a multi-command with the following content

            "command": "multiCommand.fixswitch",
            "sequence": [
                "cursorRightSelect",
                "editor.action.selectHighlights",
                "cursorLeft",
                "type"
            ]

The last command type is what VS Code outputs to the OUTPUT (Log(window)) when having set Log Level to Trace (found via #12) and pressing 'enter'

Type doesn't seem to actually do anything. I need it to press 'enter' Any ideas?

jonasmellquist commented 5 years ago

I managed to figure it out myself with help from https://code.visualstudio.com/docs/getstarted/keybindings#_command-arguments

Here's the solution that worked out for me at the end - almost crying over here ;)

            "sequence": [
                "cursorRightSelect",
                "editor.action.selectHighlights",
                "cursorLeft",
                { "key": "enter", "command": "type",
                    "args": { "text": "\n" }},
                "cancelSelection",
                "cursorTop",
                "deleteRight"
            ]

Thanks for making this great extension!