Skip to content

Commit

Permalink
added menu for opening settings file
Browse files Browse the repository at this point in the history
  • Loading branch information
ldgit committed Dec 20, 2015
1 parent b0fc54a commit d79053d
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 5 deletions.
3 changes: 0 additions & 3 deletions Calculator.sublime-settings

This file was deleted.

34 changes: 34 additions & 0 deletions Main.sublime-menu
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[
{
"caption": "Preferences",
"mnemonic": "n",
"id": "preferences",
"children":
[
{
"caption": "Package Settings",
"mnemonic": "P",
"id": "package-settings",
"children":
[
{
"caption": "Hours Calculator",
"children":
[
{
"caption": "Settings – Default",
"command": "open_file",
"args": { "file": "${packages}/hours-calculator/hours-calculator.sublime-settings" }
},
{
"caption": "Settings – User",
"command": "open_file",
"args": { "file": "${packages}/User/hours-calculator.sublime-settings" }
}
]
}
]
}
]
}
]
2 changes: 1 addition & 1 deletion app/settings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class Settings():
PLUGIN_FOLDER = 'Calculator'
PLUGIN_FOLDER = 'hours-calculator'

def __init__(self, sublime):
self._settings_file = self.PLUGIN_FOLDER + '.sublime-settings'
Expand Down
4 changes: 4 additions & 0 deletions hours-calculator.sublime-settings
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
// Used to visually seaprate calculation result
"separator": "====="
}
2 changes: 1 addition & 1 deletion tests/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def setUp(self):

def test_folder_and_settings_file_name(self):
self.settings.separator
self.assertEqual('Calculator.sublime-settings', self.sublime.settings_file_to_load)
self.assertEqual('hours-calculator.sublime-settings', self.sublime.settings_file_to_load)

def test_settings_file_actually_exists(self):
from os import path
Expand Down

0 comments on commit d79053d

Please sign in to comment.