I recently wrote a key binding that applies specifically to HTML and CSS files. It works as expected when I try to invoke it in any CSS file. But when I try to invoke it in an HTML file it doesn’t work.
This is the code snippet for the key binding that I wrote:
{
"keys": ["ctrl+alt+b"],
"command": "move_to",
"args": {
"to": "eol",
"extend": false
},
"context": [
{
"key": "selector",
"operator": "equal",
"operand": "source.html, source.css"
}
]
}
To confirm that this problem was only with HTML file type, I wrote other key bindings setting their context to specific file types. When I tried to invoke them in their specified file types, only the HTML files failed.
I spent a lot of time thinking about where I went wrong. Can someone please help me solve this problem?
I have used the chain package to link multiple commands with a single key binding.