sublime-hooks 插件 - 事件挂钩上的多个命令

sublime-hooks plugin - multiple commands on event hook

我使用 sublime-hooks 插件来 运行 事件挂钩上的 sublime 命令。我通常使用它来 运行 事件挂钩上只有一个命令。我不知道如何在一个事件挂钩上 运行 多个命令。我试过这个,但它不起作用。

CSS.sublime-设置

    {
    "on_pre_save_language": [
        {
            "command": [
                "autoprefixer",
                "css_comb"
            ]
        }
    ]
}

根据plugin docs提供的link:

Hooks are stored in the User, Project, or Language settings. Each of these expects a list of dictionaries. Each of those dictionaries satisfies the following:

  • command [...]
  • args [...]
  • scope [...]
  • views [...]

所以不要创建命令数组,而是为每个命令添加一个对象(command/args)到数组:

{
    "on_pre_save_language": [
        {
            "command": "autoprefixer"
        },
        {
            "command": "css_comb"
        }
    ]
}