diff --git a/PlainTasks.py b/PlainTasks.py index 71cbdf0..698f572 100644 --- a/PlainTasks.py +++ b/PlainTasks.py @@ -154,9 +154,9 @@ def runCommand(self, edit): original = [r for r in self.view.sel()] done_line_end, now = self.format_line_end(self.done_tag, tznow()) offset = len(done_line_end) - rom = r'^(\s*)(\[\s\]|.)(\s*.*)$' + rom = r'^(\s*)((?:\*\s)?\[\s\]|.)(\s*.*)$' rdm = r''' - (?x)^(\s*)(\[x\]|.) # 0,1 indent & bullet + (?x)^(\s*)((?:\*\s)?\[x\]|.) # 0,1 indent & bullet (\s*[^\b]*?(?:[^\@]|(? - fileTypes - - todo - tasks - todolist.txt - - keyEquivalent - ^~T - name - Tasks - patterns - - - match - ^\s*(\w+.*?:\s*?(\@[^\s]+(\(.*?\))?\s*?)*$\n?) - name - keyword.control.header.todo - + fileTypes + + todo + tasks + todolist.txt + + keyEquivalent + ^~T + name + Tasks + patterns + + + match + ^\s*(\w+.*?:\s*?(\@[^\s]+(\(.*?\))?\s*?)*$\n?) + name + keyword.control.header.todo + - - captures - - 1 - - name - punctuation.definition.bullet.completed.todo - - 2 - - name - comment.line.completed.todo - - 3 - - name - meta.tag.todo.completed - - 4 - - name - punctuation.definition.bullet.completed.todo - - 5 - - name - comment.line.completed.todo - - 6 - - name - meta.tag.todo.completed - - - match - ^\s*(?:(\+|✓|✔|☑|√|\[x\])(\s+(?:[^\@\n]|(?<!\s)\@|\@(?=\s))*)([^\n]*))|^\s*(?:(-)(\s+(?:[^\@]|(?<!\s)\@|\@(?=\s))*)(.*\@done(?=\s|\(|$)[^\n]*)) - name - meta.item.todo.completed - + + captures + + 1 + + name + punctuation.definition.bullet.completed.todo + + 2 + + name + comment.line.completed.todo + + 3 + + name + meta.tag.todo.completed + + 4 + + name + punctuation.definition.bullet.completed.todo + + 5 + + name + comment.line.completed.todo + + 6 + + name + meta.tag.todo.completed + + + match + ^\s*(?:(\+|✓|✔|☑|√|(?:\*\s)?\[x\])(\s+(?:[^\@\n]|(?<!\s)\@|\@(?=\s))*)([^\n]*))|^\s*(?:(-)(\s+(?:[^\@]|(?<!\s)\@|\@(?=\s))*)(.*\@done(?=\s|\(|$)[^\n]*)) + name + meta.item.todo.completed + - - captures - - 1 - - name - punctuation.definition.bullet.cancelled.todo - - 2 - - name - text.cancelled.todo - - 3 - - name - meta.tag.todo.cancelled - - 4 - - name - punctuation.definition.bullet.cancelled.todo - - 5 - - name - text.cancelled.todo - - 6 - - name - meta.tag.todo.cancelled - - - match - ^\s*(?:(✘|x|\[-\])(\s+(?:[^\@\n]|(?<!\s)\@|\@(?=\s))*)(.*))|^\s*(?:(-)(\s+(?:[^\@]|(?<!\s)\@|\@(?=\s))*)(.*\@cancelled(?=\s|\(|$)[^\n]*)) - name - meta.item.todo.cancelled - + + captures + + 1 + + name + punctuation.definition.bullet.cancelled.todo + + 2 + + name + text.cancelled.todo + + 3 + + name + meta.tag.todo.cancelled + + 4 + + name + punctuation.definition.bullet.cancelled.todo + + 5 + + name + text.cancelled.todo + + 6 + + name + meta.tag.todo.cancelled + + + match + ^\s*(?:(✘|x|(?:\*\s)?\[-\])(\s+(?:[^\@\n]|(?<!\s)\@|\@(?=\s))*)(.*))|^\s*(?:(-)(\s+(?:[^\@]|(?<!\s)\@|\@(?=\s))*)(.*\@cancelled(?=\s|\(|$)[^\n]*)) + name + meta.item.todo.cancelled + - - begin - ^\s*(?!-|\+|✓|✔|√|❍|❑|■|□|☐|▪|▫|–|—|≡|→|›|\[[\sx-]\]|_|✘|(x\s+))(?=\S) - end - $\n? - name - notes.todo - patterns - - - include - #italic - - - include - #bold - - - include - #url - - - + + begin + ^\s*(?!-|\+|✓|✔|√|❍|❑|■|□|☐|▪|▫|–|—|≡|→|›|(?:\*\s)?\[[\sx-]\]|_|✘|(x\s+))(?=\S) + end + $\n? + name + notes.todo + patterns + + + include + #italic + + + include + #bold + + + include + #url + + + - - captures - - 1 - - name - punctuation.definition.bullet.pending.todo - - - begin - ^\s*(-|❍|❑|■|□|☐|▪|▫|–|—|≡|→|›|\[\s\])(?=(\s+(?:[^\@\n]|(?<![ \t])\@)*)(?!([^\n]*)?(\@done|\@cancelled)[\s\(])) - end - $ - name - meta.item.todo.pending - patterns - - - include - #italic - - - include - #bold - - - include - #url - - - include - #tag - - - include - #today - - - include - #low - - - include - #high - - - include - #critical - - - + + captures + + 1 + + name + punctuation.definition.bullet.pending.todo + + + begin + ^\s*(-|❍|❑|■|□|☐|▪|▫|–|—|≡|→|›|(?:\*\s)?\[\s\])(?=(\s+(?:[^\@\n]|(?<![ \t])\@)*)(?!([^\n]*)?(\@done|\@cancelled)[\s\(])) + end + $ + name + meta.item.todo.pending + patterns + + + include + #italic + + + include + #bold + + + include + #url + + + include + #tag + + + include + #today + + + include + #low + + + include + #high + + + include + #critical + + + - - match - ^_+$ - name - meta.punctuation.archive.todo - + + match + ^_+$ + name + meta.punctuation.archive.todo + - - match - ^\s*---.{3,5}---+$ - name - meta.punctuation.separator.todo - + + match + ^\s*---.{3,5}---+$ + name + meta.punctuation.separator.todo + - + - repository - + repository + - bold - - captures - - 1 - - name - punctuation.definition.bold - - - begin - (?<=\s|^)(\*\*|__)(?=\S)(?=(?!(?<=\S)\1)[^\n]+(?<=\S)\1)(?=[^\n]+(?<=\S)(\1)((?![\w\d\n])|(?=\s|$))) - end - (?<=\S)(\1)((?![\w\d\n])|(?=\s|$)) - name - todo.bold - + bold + + captures + + 1 + + name + punctuation.definition.bold + + + begin + (?<=\s|^)(\*\*|__)(?=\S)(?=(?!(?<=\S)\1)[^\n]+(?<=\S)\1)(?=[^\n]+(?<=\S)(\1)((?![\w\d\n])|(?=\s|$))) + end + (?<=\S)(\1)((?![\w\d\n])|(?=\s|$)) + name + todo.bold + - italic - - captures - - 1 - - name - punctuation.definition.italic - - - begin - (?<=\s|^)(\*|_)(?=\S)(?=(\1\1|(?!(?<=\S)\1).)++(?<=\S)\1)(?=[^\n]+(?<=\S)(\1)(?!\1|[\w\d])) - end - (?<=\S)(\1)(?!\1|[\w\d]) - name - todo.italic - + italic + + captures + + 1 + + name + punctuation.definition.italic + + + begin + (?<=\s|^)(\*|_)(?=\S)(?=(\1\1|(?!(?<=\S)\1).)++(?<=\S)\1)(?=[^\n]+(?<=\S)(\1)(?!\1|[\w\d])) + end + (?<=\S)(\1)(?!\1|[\w\d]) + name + todo.italic + - url - - captures - - 1 - - name - punctuation.definition.url - - - match - (?<!\S)(<)\w+?(?!\s)(\.|:)(?!\s)[^\n]+?(>) - name - todo.url - + url + + captures + + 1 + + name + punctuation.definition.url + + + match + (?<!\S)(<)\w+?(?!\s)(\.|:)(?!\s)[^\n]+?(>) + name + todo.url + - tag - - match - (?<=\s)\@(?!(high|today|critical|low|completed|done)[\s\(])[\w\d\.\(\)\-!? :\+]+[ \t]* - name - meta.tag.todo - + tag + + match + (?<=\s)\@(?!(high|today|critical|low|completed|done)[\s\(])[\w\d\.\(\)\-!? :\+]+[ \t]* + name + meta.tag.todo + - today - - match - (?<=\s)\@today|✭ᴛᴏᴅᴀʏ - name - string.other.tag.todo.today - + today + + match + (?<=\s)\@today|✭ᴛᴏᴅᴀʏ + name + string.other.tag.todo.today + - low - - match - (?<=\s)\@low|✭low - name - string.other.tag.todo.low - + low + + match + (?<=\s)\@low|✭low + name + string.other.tag.todo.low + - high - - match - (?<=\s)\@high|✭high - name - string.other.tag.todo.high - + high + + match + (?<=\s)\@high|✭high + name + string.other.tag.todo.high + - critical - - match - (?<=\s)\@critical|✭critical - name - string.other.tag.todo.critical - + critical + + match + (?<=\s)\@critical|✭critical + name + string.other.tag.todo.critical + - - scopeName - text.todo - uuid - 8fj2g29c-04ef-4330-9a6b-9b99aae1c418 + + scopeName + text.todo + uuid + 8fj2g29c-04ef-4330-9a6b-9b99aae1c418 diff --git a/Readme.md b/Readme.md index 9e31799..6bcc94d 100644 --- a/Readme.md +++ b/Readme.md @@ -173,9 +173,9 @@ Here is a list of PlainTasks’ specific settings: | Setting | Default | Options/Description | | ------------------------------ | ---------------- | ----------------------------------------------------------------------- | -| **open_tasks_bullet** | `☐` | `-` `❍` `❑` `■` `□` `☐` `▪` `▫` `–` `—` `≡` `→` `›` `[ ]` | -| **done_tasks_bullet** | `✔` | `✓` `☑` `+` `[x]` | -| **cancelled_tasks_bullet** | `✘` | `x` `[-]` | +| **open_tasks_bullet** | `☐` | `-` `❍` `❑` `■` `□` `☐` `▪` `▫` `–` `—` `≡` `→` `›` `[ ]` `* [ ]` | +| **done_tasks_bullet** | `✔` | `✓` `☑` `+` `[x]` `* [x]` | +| **cancelled_tasks_bullet** | `✘` | `x` `[-]` `* [-]` | | **date_format** | `(%y-%m-%d %H:%M)` | See [strfti.me](http://www.strfti.me/) for quick reference; detailed documentation: [ST2](https://docs.python.org/2.6/library/datetime.html#strftime-and-strptime-behavior), [ST3](https://docs.python.org/3.3/library/datetime.html#strftime-and-strptime-behavior) | | **done_tag** | true | Determines whether done tasks should gain a `@done` tag or not | | **done_date** | true | Determines whether done tasks should gain a date or not |