Sublime keymap中前一文本的多行匹配

时间:2014-10-14 14:19:41

标签: sublimetext3

我的sublime-keymap中有以下命令:

{
    "keys": ["tab"],
    "command": "insert_snippet",
    "args": { "contents": "${1:key}: ${0:'value'}" },
    "context": [
        { "key": "selector", "operator": "equal", "operand": "source.js" },
        { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
        { "key": "preceding_text", "operator": "regex_contains", "operand": "\\{\\s*$" },
        { "key": "preceding_text", "operator": "not_regex_contains", "operand": "\\)\\s*\\{\\s*$" }
    ]
},

这匹配以下文本就好了(管道=插入点):

{ |

......但不是这样:

{
   |

...因为preceding_text似乎只在同一行包含前面的文字。有没有办法在这里匹配多行?

0 个答案:

没有答案