I have this key command:
{
"command": "show_panel", "args": {"panel": "output.clang", "toggle": true},
"keys": "ctrl+d", "ctrl+p"]
}
But pressing ctrl+d,ctrl+p only shows the panel, not hides it.
What have I missed?
I have this key command:
{
"command": "show_panel", "args": {"panel": "output.clang", "toggle": true},
"keys": "ctrl+d", "ctrl+p"]
}
But pressing ctrl+d,ctrl+p only shows the panel, not hides it.
What have I missed?
Yes it does. Is this the intended behavior?
Personally Iâd like to hide it even if it doesnât have focus. That way I can press the key combo once to show it, then go âah, thatâs whatâs happeningâ and then press the key combo again to hide it.
Agreed, itâs an oversight in the way panel toggling works: all the other panels grab input focus when shown, but not the output panel
Hmm, are we talking about the side bar here? Because I try to show/hide the side bar with the keyboard shortcut that shows up next to the menu item (View > Sidebar > Hide sidebar âK, âB). However, âK triggers Reindent (even though there is no shortcut shown next to the menu item) and âB triggers Build.
Am I missing something here?
jps, this never started working btw. I got reminded today when a SublimeClang user opened up an issue at github for this.
Iâm facing the same with the output.exec
panel, and even when the output panel has the focus, toggle does not work and seems to be ignored. The hide_panel
command works, just not the toggle
argument to show_panel
.
Note: using Sublime Text 3 build 3083 and invoking the command on the window object of a WindowCommand
object during run()
.
â Edit â
The same with the console panel or any user created panel, as I just wanted to check.
For that reason, I am using this in my key bindings:
// Toggle exec output
{ "keys": "ctrl+f4"], "command": "show_panel", "args": {"panel": "output.exec"} },
{ "keys": "ctrl+f4"], "command": "hide_panel", "args": {"panel": "output.exec"},
"context": [
{ "key": "panel", "operand": "output.exec" }
]
},
Canât really do that from a plugin though.
Ah, that helps.
There needs to be an opening bracket after "context":
, which was missing in my snippet above. I just edited it in.
Is it possible to do something like that for errors too? Cycle through errors with a hotkey?
That is already built in, on F4, assuming the build system was set up accordingly.
For Sublime Text 3. Some summary here.
1. The toggle
option is available on
(1) Find panel
(2) Find in All Files panel
(3) Incremental Find panel
(4) Replace panel
(5) Console panel
For example, you can set
{
"keys": ["alt+`"],
"command": "show_panel",
"args": {
"panel": "console",
"toggle": true
}
}
so that with alt + ` you can toggle (show or hide) the console panel.
2. Unfortunately, the toggle
option does not work in other panels, including the built-in
(1) Find in All Files Results panel (output.find_results
)
(2) Build Results panel (output.exec
)
The workaround is as @FichteFoll put it - to assign the show_panel
and hide_panel
commands to the same shortcut key. For example,
[
{
"keys": ["alt+v"],
"command": "show_panel",
"args": {
"panel": "output.exec"
}
},
{
"keys": ["alt+v"],
"command": "hide_panel",
"args": {
"panel": "output.exec"
},
"context": [{
"key": "panel", "operand": "output.exec"
}]
}
]
so that with alt + v you can toggle (show or hide) the Build Results (output.exec
) panel.
Note the show_panel
is an unconditional command, whereas the hide_panel
here is a conditional command which only happens in certain context. So the order of the two matters - you should put hide_panel
after show_panel
, otherwise show_panel
will prevail in all circumstances and the conditional hide_panel
wonât work.