Sublime Forum

How to load a custom package setting respecting the Sublime Text settings hierarchy?

#1

Sublime Text has the following settings load order, accordingly to the docs:

  1. Packages/Default/Preferences.sublime-settings
  2. Packages/Default/Preferences (<platform>).sublime-settings
  3. Packages/User/Preferences.sublime-settings
  4. <Project Settings>
  5. Packages/<syntax>/<syntax>.sublime-settings
  6. Packages/User/<syntax>.sublime-settings
  7. <Buffer Specific Settings>
    https://www.sublimetext.com/docs/3/settings.html

If you would like to implement a global setting not tied to a specific package or just fix the issue:

  1. Core$679 show_panel_on_build setting isn’t loaded from syntax specific settings

How should you load your settings, so this hierarchy is respected?

Related topics:

  1. forum$35858 Load_settings(base_name) and save_settings(base_name) only searching the User package
  2. forum$18926 The Settings Hierarchy: Syntax-Specific over Project-Specific?
0 Likes

#2

I think that, as mentioned on Core$679, instead of loading the setting as:

sublime.load_settings("Preferences.sublime-settings").get("show_panel_on_build", True)

Load it as:

self.window.active_view().settings().get("show_panel_on_build", True)

Then, the Sublime Text hierarchy showed on Documentation Settings should be respected.

1 Like