我的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
似乎只在同一行包含前面的文字。有没有办法在这里匹配多行?