Skip to content

Instantly share code, notes, and snippets.

@OdatNurd
Created October 26, 2021 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OdatNurd/f2190cc96fa037866d3224e29320d854 to your computer and use it in GitHub Desktop.
Save OdatNurd/f2190cc96fa037866d3224e29320d854 to your computer and use it in GitHub Desktop.
Sublime Text 4 plugin that forces the SideBar to be visible when windows are opened
import sublime
import sublime_plugin
class SideBarEventListener(sublime_plugin.EventListener):
"""
Ensures that the side bar is always enabled in every window by making sure
that whenever a window is opned or a project is opened, the side bar is
turned on in that window.
This requires Sublime Text 4; Sublime Text 3 does not include the two
events used here.
"""
def on_new_window(self, window):
if not window.is_sidebar_visible():
window.set_sidebar_visible(True)
on_load_project = on_new_window
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment