Home Download Buy Blog Forum Support

How to get visibility and focus of sidebar?

How to get visibility and focus of sidebar?

Postby Binocular222 on Sat Jan 04, 2014 5:03 am

As title say.

Background: the following code does not hide the sidebar because self.view.window().run_command("focus_side_bar") is nullified by the fact that sidebar is already visible and focused:
Code: Select all
import sublime, sublime_plugin

class toggle_sidebar(sublime_plugin.TextCommand):
    def run(self, edit):
        self.view.window().run_command("toggle_side_bar")
        self.view.window().run_command("focus_side_bar")

So, I need to check sidebar visibility & focus status to decide whether to run focus_side_bar command
Binocular222
 
Posts: 55
Joined: Sat May 18, 2013 4:10 pm

Return to Plugin Development

Who is online

Users browsing this forum: Yahoo [Bot] and 7 guests