Skip to content

Commit bd7174d

Browse files
committed
correctly convert sort order list to str, small lint fixes
1 parent 5c08bee commit bd7174d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

CSScomb.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import sublime
55
import sublime_plugin
66
import subprocess
7+
import json
78
from os import path, name
89

910
__file__ = path.normpath(path.abspath(__file__))
@@ -36,9 +37,8 @@ def run(self, edit):
3637

3738
self.sortorder = False
3839
self.order_settings = sublime.load_settings('CSScomb.sublime-settings')
39-
if self.order_settings.has('custom_sort_order') and self.order_settings.get('custom_sort_order') == True:
40-
self.sortorder = self.order_settings.get('sort_order')
41-
self.sortorder = '["' + '","'.join(self.sortorder) + '"]'
40+
if self.order_settings.has('custom_sort_order') and self.order_settings.get('custom_sort_order') is True:
41+
self.sortorder = json.dumps(self.order_settings.get('sort_order'))
4242
sublime.status_message('Sorting with custom sort order...')
4343
else:
4444
self.sortorder = ''
@@ -79,7 +79,7 @@ def get_selections(self):
7979
# check if the user has any actual selections
8080
has_selections = False
8181
for region in selections:
82-
if region.empty() == False:
82+
if region.empty() is False:
8383
has_selections = True
8484

8585
# if not, add the entire file as a selection

0 commit comments

Comments
 (0)