I have actually two working panels in sublime text 3 and have to set shortcut key which performs two tasks, i.e close the current file & move the cursor to left panel. I've written following in keymap:
[
{
"keys": ["ctrl+alt+z"],
"command": "chain",
"args": {
"commands": [
["close_file"],
["focus_group",{"group": 0}]
]
}
}
]
but it does not works if there is only one file open in right panel.It actually closes that file but does not moves cursor to left panel. If anyone can help then it will be thankful.
You have found what I am pretty sure is a bug in the ChainOfCommand plugin, I suggest you report the bug here.
Until the bug is fixed you can work around it by introducing an extra "dummy_command"
in between the close file command and the focus group command as shown below.
{
"keys": ["ctrl+alt+z"],
"command": "chain",
"args": {
"commands": [
["close_file"],
["dummy_command"],
["focus_group", {"group": 0}]
]
}
},
I discovered that this worked by accident after seeing whether the focus command would work if a "new_file"
command was run in between the "close_file"
and "focus_group"
commands. When the focus group was successful I tried replacing the "new_file"
command with the "dummy_command"
and that worked too. It is not ideal but it works.