- Code: Select all
, {
"keys" : ["enter"]
, "command" : "insert_snippet"
, "args" : {"contents": "\n* "}
, "context" : [
{ "key" : "selector", "operator": "equal", "operand": "source.js comment.block.documentation.js" }
]
}
, {
"keys" : ["enter"]
, "command" : "insert_snippet"
, "args" : {"contents": "\n* "}
, "context" : [
{ "key" : "selector", "operator": "equal", "operand": "source.js comment.block.documentation.js" }
]
}{ "key" : "selector", "operator": "regex_contains", "operand": ".*comment.block.*" } { "key" : "selector", "operator": "regex_contains", "operand": "comment\.block" } { "key" : "selector", "operator": "equal", "operand": "comment.block" }
view.match_selector(view.sel()[0].a, "comment.block")
jps wrote:regex_contains only works with the preceding_text, text, and following_text keys.
To match vs all block comments, you just want to use a selector:
- Code: Select all
{ "key" : "selector", "operator": "equal", "operand": "comment.block" }
You can test selectors via positioning the caret at the desired location, and then using the console:
- Code: Select all
view.match_selector(view.sel()[0].a, "comment.block")
Users browsing this forum: No registered users and 5 guests