Skip to content

Commit 9fe6e65

Browse files
committed
Add In Progress state to st3
1 parent a0335b5 commit 9fe6e65

File tree

3 files changed

+28
-10
lines changed

3 files changed

+28
-10
lines changed

Diff for: SublimeTask.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,21 @@ def run(self, edit):
1616
self.view.replace(edit, line_region, processed_line)
1717

1818
def process(self, line):
19-
p = re.compile('^(\s*)([-✓])(.*)', re.UNICODE)
19+
p = re.compile('^(\s*)([-~✓])(.*)', re.UNICODE)
2020
m = p.match(line)
2121
if m:
22-
symbol = '✓' if m.group(2) == '-' else '-'
22+
symbol = '-'
23+
if m.group(2) == '-':
24+
symbol = '~'
25+
elif m.group(2) == '~':
26+
symbol = '✓'
27+
2328
result = '%(leading_whitespace)s%(symbol)s%(content)s' % {'leading_whitespace': m.group(1), 'symbol': symbol, 'content': m.group(3)}
2429
return result
2530
else:
2631
return line
2732

33+
2834
def current_encoding(self):
2935
if self.view.encoding() == 'Undefined':
3036
return self.view.settings().get('default_encoding', 'UTF-8')

Diff for: Task.JSON-tmLanguage

+8-4
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,19 @@
1111
"match": "[\\[\\]]",
1212
"comment": "[ and ]"
1313
},
14-
{ "name": "variable",
15-
"match": "^[^-✓]*:\\s+",
14+
{ "name": "support.function",
15+
"match": "^[^-~✓]*:\\s+",
1616
"comment": "Task Title"
1717
},
18-
{ "name": "string",
18+
{ "name": "variable.parameter",
19+
"match": "^\\s*~[^\\[\\]]*",
20+
"comment": "Started Tasks"
21+
},
22+
{ "name": "entity.other.attribute-name",
1923
"match": "^\\s*✓[^\\[\\]]*",
2024
"comment": "Completed Tasks"
2125
},
22-
{ "name": "constant",
26+
{ "name": "keyword",
2327
"match": "^\\s*-[^\\[\\]]*",
2428
"comment": "Action Items"
2529
},

Diff for: Task.tmLanguage

+12-4
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,33 @@
3434
<key>comment</key>
3535
<string>Task Title</string>
3636
<key>match</key>
37-
<string>^[^-✓]*:\s+</string>
37+
<string>^[^-~✓]*:\s+</string>
3838
<key>name</key>
39-
<string>variable</string>
39+
<string>support.function</string>
40+
</dict>
41+
<dict>
42+
<key>comment</key>
43+
<string>Started Tasks</string>
44+
<key>match</key>
45+
<string>^\s*~[^\[\]]*</string>
46+
<key>name</key>
47+
<string>variable.parameter</string>
4048
</dict>
4149
<dict>
4250
<key>comment</key>
4351
<string>Completed Tasks</string>
4452
<key>match</key>
4553
<string>^\s*✓[^\[\]]*</string>
4654
<key>name</key>
47-
<string>string</string>
55+
<string>entity.other.attribute-name</string>
4856
</dict>
4957
<dict>
5058
<key>comment</key>
5159
<string>Action Items</string>
5260
<key>match</key>
5361
<string>^\s*-[^\[\]]*</string>
5462
<key>name</key>
55-
<string>constant</string>
63+
<string>keyword</string>
5664
</dict>
5765
<dict>
5866
<key>comment</key>

0 commit comments

Comments
 (0)