Skip to content

Commit

Permalink
add toggler to disable custom sort order, rename settings file
Browse files Browse the repository at this point in the history
  • Loading branch information
i-akhmadullin committed Feb 4, 2013
1 parent c2f0279 commit fc94b86
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CSScomb.py
Expand Up @@ -20,8 +20,8 @@ def __init__(self, view):

def run(self, edit):
self.sortorder = False
self.order_settings = sublime.load_settings('CSScomb - Order.sublime-settings')
if self.order_settings:
self.order_settings = sublime.load_settings('CSScomb.sublime-settings')
if self.order_settings.has('custom_sort_order') and self.order_settings.get('custom_sort_order') == True:
self.sortorder = self.order_settings.get('sort_order')
sublime.status_message('Sorting with custom sort order...')

Expand Down
@@ -1,4 +1,5 @@
{
"custom_sort_order": false,
"sort_order": [
"position",
"top",
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -44,6 +44,7 @@ To customize it do following:
3. Open user-defined sort order: `Preferences``Package Settings``CSScomb``Sort Order – User`
4. Paste in this file.
5. Change order how you want.
6. Set `custom_sort_order` value to `true`

## Issues & bugs

Expand Down
7 changes: 5 additions & 2 deletions csscomb/localsort.py
Expand Up @@ -25,8 +25,11 @@ def check_php_on_path(self):

def exec_request(self):
if not self.error:
order = '["' + '","'.join(self.sortorder) + '"]'
myprocess = subprocess.Popen(['php', csscomb_path, self.original, order], shell=False, stdout=subprocess.PIPE, startupinfo=self.startupinfo)
if self.sortorder != False:
order = '["' + '","'.join(self.sortorder) + '"]'
myprocess = subprocess.Popen(['php', csscomb_path, self.original, order], shell=False, stdout=subprocess.PIPE, startupinfo=self.startupinfo)
else:
myprocess = subprocess.Popen(['php', csscomb_path, self.original, ''], shell=False, stdout=subprocess.PIPE, startupinfo=self.startupinfo)
(sout, serr) = myprocess.communicate()
myprocess.wait()

Expand Down

0 comments on commit fc94b86

Please sign in to comment.