Home Download Buy Blog Forum Support

Macro weirdness

Macro weirdness

Postby quodlibet on Thu Apr 10, 2014 3:54 pm

I want to create a macro, using commands from the Git plugin, that (1) unstages all files, (2) adds the current file and then (3) commits to the repo.

My macro file is this:

Code: Select all
[
   { "command": "git_reset_head_all" },
   { "command": "git_add" },
   { "command": "git_commit" }
]


When I execute the macro, I get this error:

Code: Select all
Unknown macro command git_reset_head_all
Unknown macro command git_commit


Both are valid Git commands. Any idea what's going on?

Alex
quodlibet
 
Posts: 554
Joined: Sat Jun 18, 2011 5:53 pm

Re: Macro weirdness

Postby skuroda on Fri Apr 11, 2014 5:57 am

It's possible those are window commands. ST macros only support text commands. You may want to check out https://github.com/skuroda/ImprovedMacros. I had intended to find a way to replace the ST macros to record window commands, among other things, but haven't found a good way to do it yet. I haven't written any docs for it as the functionality I wanted to implement isn't done, so take a look at viewtopic.php?f=5&t=8677&start=10#p50802 for an example key binding/arguments.

You can install the plugin by adding it as a repository in package control. The command you will use for the key binding (if you use my version) is "run_multiple_commands".
skuroda
 
Posts: 687
Joined: Fri Oct 05, 2012 8:11 am

Re: Macro weirdness

Postby quodlibet on Mon Apr 14, 2014 10:14 am

I still can't get the git commands to work. Grumble, grumble.

After installing the plugin, this is the command I'm using:

Code: Select all
    {
        "caption": "Git: Commit Current File (Macro)",
        "command": "run_multiple_commands",
        "args": {
            "commands":
            [
                { "command": "git_reset_head_all" },
                { "command": "git_add" },
                { "command": "git_commit" }
            ]
        }
    },


The run_multiple_commands works fine with other commands, but the git stuff do nothing.

No errors in the console and command logging only returns:

Code: Select all
command: run_multiple_commands {"commands": [{"command": "git_reset_head_all"}, {"command": "git_add"}, {"command": "git_commit"}]}


Any ideas?

Alex
quodlibet
 
Posts: 554
Joined: Sat Jun 18, 2011 5:53 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 16 guests

cron