geddski / macros

macros support for VS Code
MIT License
165 stars 36 forks source link

Order of Operations Seems to Be off with Cursors and Type #26

Open jdubwelch opened 6 years ago

jdubwelch commented 6 years ago

Maybe I'm not understanding this correctly, but it isn't working as expected.

Here is an example:

"example": [
    "cursorDown",
    {"command": "type", "args": {"text": "down"}},
    "cursorUp"
    {"command": "type", "args": {"text": "up"}}
],

What I end up with when the cursor (represented with the pipe (|) below) starts are line 1:

1 downup|
2
3

I'm expecting it to do:

1 up|
2 down
3
mohamed-atef commented 6 years ago

I'm facing the same issue and the macro is this "addArrayCommaWithNewLine":[ "cursorEnd", {"command": "type", "args": {"text": ","}}, "editor.action.insertLineAfter", ],