Skip to content

Commit

Permalink
Internal: specify GitSavvy settings under root node
Browse files Browse the repository at this point in the history
  • Loading branch information
randy3k committed Apr 7, 2018
1 parent 21ca799 commit 066b126
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
6 changes: 3 additions & 3 deletions GitSavvy.sublime-project
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"GitSavvy":
{
},
"build_systems":
[
{
Expand All @@ -23,9 +26,6 @@
],
"settings":
{
"GitSavvy":
{
},
"rulers":
[
100,
Expand Down
6 changes: 2 additions & 4 deletions common/global_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,8 @@ def run(self):

if project_data is None:
project_data = {}
if "settings" not in project_data:
project_data["settings"] = {"GitSavvy": {}}
if "GitSavvy" not in project_data["settings"]:
project_data["settings"]["GitSavvy"] = {}
if "GitSavvy" not in project_data:
project_data["GitSavvy"] = {}

self.window.set_project_data(project_data)

Expand Down
4 changes: 2 additions & 2 deletions core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ def __init__(self, parent=None):

def get(self, key, default=None):
project_data = sublime.active_window().project_data()
if project_data and "settings" in project_data and "GitSavvy" in project_data["settings"]:
project_savvy_settings = project_data["settings"]["GitSavvy"]
if project_data and "GitSavvy" in project_data:
project_savvy_settings = project_data["GitSavvy"]
if key in project_savvy_settings:
return project_savvy_settings.get(key)
return self.global_settings.get(key, default)
Expand Down
7 changes: 2 additions & 5 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,9 @@ To open the GitSavvy settings, simply run the `Preferences: GitSavvy Settings` c

```
{
"settings":
"GitSavvy":
{
"GitSavvy":
{
// GitSavvy settings go here
}
// GitSavvy settings go here
}
}
```
Expand Down

0 comments on commit 066b126

Please sign in to comment.