Closed YayC closed 8 years ago
Which build of Sublime 3? I'm not sure if it's only in the dev build, but they have introduced a way for the plugin to track when the sidebar is toggled (there still isn't a proper "is sidebar visible" api).
Build 3065
hmm, that build should definitely work. Can you describe a bit more about when you toggle the sidebar, and when it re-appears?
Yup, sorry for the lack of context. I close the sidebar with the default shortcut (command + k, command + b). When I switch to another tab, it reopens. I tried with the console open and sublime.log_commands(True)
, but no output there. When I disable sidebar syncing via command palette, the sidebar remains closed.
Not a big issue, as it's very easy to turn syncing on/off via command palette. If there was an actual "toggle" command, you could also remap the "toggle sidebar" shortcut to also toggle sidebar syncing (using the chain of command plugin).
That might be the clue. When I set log_commands to true, and hide the sidebar (I also use the mac keyboard shortcut), I get:
command: toggle_side_bar
That is what the plugin uses to detect the sidebar has been hidden. The only time this doesn't work is when a window opens (e.g. when sublime first loads), the plugin has to assume the sidebar is visible as it can't query for that info.
Another example is when you are in "Distraction Free Mode" and you have two files side by side. Clicking on each would bring up the sidebar. (SublimeText 2, Build#2221)
I might be able to listen for when distraction mode is triggered, but I don't believe there is an API to query whether it is active.
Really, without a way to know for sure that the sidebar has been hidden everything this plugin does to avoid opening it is a blind guess.
I think having it for "Distraction free mode" would be very good.
I've been trying to figure this sucker out for a few days now, It's driving me insane - has anyone got any ideas how to prevent the sidebar from appearing when hidden with this plugin?
If all else fails, there are commands to enable and disable the plugin. You can use that to turn it off temporarily.
I haven't tested it recently but it should also be possible to turn the plugin off for a single project using a config entry in the sublime project file.
I'm using sublime text build 3065, still got the same problem.
@YayConnolly can you teach me how to use chain of command
to do so?
@UniFreak been a while, but in my Preferences: Key Bindings - User
file I have this line for example:
{
"keys": ["ctrl+l", "r"],
"command": "chain",
"args": {
"commands": [
["rubocop_check_single_file"],
["hide_panel", {"cancel": true}]
]
}
},
There's a new build of Sublime 3 with an API to detect if the sidebar is visible :)
I'm testing an update to the plugin that uses this API instead of monitoring the toggle_side_bar
command. Looks good so far. I'll release it in a few days if there are no problems.
@TheSpyder please let use know if you applied the update. can't wait to see this bug fixed.
Everything looks good so I'll probably release it tomorrow!
I've just pushed the change. Please let me know if there are any problems :)
Works great! Thank you!
After toggling the sidebar closed, switching files re-opens the sidebar (Sublime Text 3, OSX 10.9.4)