Skip to content

Commit

Permalink
Refactor all scope naming and assignments
Browse files Browse the repository at this point in the history
  • Loading branch information
jotaen committed Mar 31, 2022
1 parent 9eaca84 commit a40f6ab
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 51 deletions.
38 changes: 17 additions & 21 deletions Mariana.sublime-color-scheme
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,31 @@
{
"scope": "source.klog",
"foreground": "#ffffff",
},
{
"scope": "meta.klog.date",
}, {
"scope": "entity.other.date.klog",
"foreground": "#ffffff",
"font_style": "underline",
},
{
"scope": "meta.klog.should_total",
}, {
"scope": "entity.other.should_total.klog",
"foreground": "#ef7af5",
},
{
"scope": "meta.klog.summary.text",
}, {
"scope": "entity.other.summary.text.klog",
"foreground": "#aaaaaa",
},
{
"scope": "meta.klog.summary.tag",
}, {
"scope": "entity.other.summary.tag.klog",
"foreground": "#c9c9c9",
"font_style": "italic",
},
{
"scope": "meta.klog.duration.positive",
}, {
"scope": "entity.other.duration.positive.klog",
"foreground": "#8ce675",
},
{
"scope": "meta.klog.duration.negative",
}, {
"scope": "entity.other.duration.negative.klog",
"foreground": "#f58078",
},
{
"scope": "meta.klog.range",
}, {
"scope": "entity.other.range.closed.klog",
"foreground": "#86c8f7",
}, {
"scope": "entity.other.range.open.klog",
"foreground": "#86c8f7",
},
]
Expand Down
38 changes: 17 additions & 21 deletions Monokai.sublime-color-scheme
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,31 @@
{
"scope": "source.klog",
"foreground": "#ffffff",
},
{
"scope": "meta.klog.date",
}, {
"scope": "entity.other.date.klog",
"foreground": "#ffffff",
"font_style": "underline",
},
{
"scope": "meta.klog.should_total",
}, {
"scope": "entity.other.should_total.klog",
"foreground": "#ef7af5",
},
{
"scope": "meta.klog.summary.text",
}, {
"scope": "entity.other.summary.text.klog",
"foreground": "#aaaaaa",
},
{
"scope": "meta.klog.summary.tag",
}, {
"scope": "entity.other.summary.tag.klog",
"foreground": "#c9c9c9",
"font_style": "italic",
},
{
"scope": "meta.klog.duration.positive",
}, {
"scope": "entity.other.duration.positive.klog",
"foreground": "#8ce675",
},
{
"scope": "meta.klog.duration.negative",
}, {
"scope": "entity.other.duration.negative.klog",
"foreground": "#f58078",
},
{
"scope": "meta.klog.range",
}, {
"scope": "entity.other.range.closed.klog",
"foreground": "#86c8f7",
}, {
"scope": "entity.other.range.open.klog",
"foreground": "#86c8f7",
},
]
Expand Down
18 changes: 9 additions & 9 deletions klog.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ contexts:
record:
# A record must start with a date.
- match: '^({{date}})'
scope: constant.language meta.klog.date
scope: constant.language.klog entity.other.date.klog
push:

# Then, there may follow a should total on the same line.
- match: '(\s+{{should_total}})?\s*'
scope: variable.function meta.klog.should_total
scope: variable.function.klog entity.other.should_total.klog

# End of headline.
- match: '$'
Expand All @@ -42,7 +42,7 @@ contexts:
# A record summary line cannot start with whitespace.
- match: '^(?=[^\s])'
push:
- meta_scope: comment meta.klog.summary.text
- meta_scope: comment.klog entity.other.summary.text.klog
- include: tag
- match: '^(?=\s)'
pop: 1
Expand All @@ -64,16 +64,16 @@ contexts:

# When the line is indented, it’s an entry.
- match: '^{{indentation}}{{duration_positive}}(?=\s|$)'
scope: constant.numeric meta.klog.duration.positive
scope: constant.numeric.klog entity.other.duration.positive.klog
push: entry_summary
- match: '^{{indentation}}{{duration_negative}}(?=\s|$)'
scope: keyword.control meta.klog.duration.negative
scope: keyword.control.klog entity.other.duration.negative.klog
push: entry_summary
- match: '^{{indentation}}{{range}}(?=\s|$)'
scope: string.quoted meta.klog.range.closed
scope: string.quoted.klog entity.other.range.closed.klog
push: entry_summary
- match: '^{{indentation}}{{open_range}}(?=\s|$)'
scope: string.quoted meta.klog.range.open
scope: string.quoted.klog entity.other.range.open.klog
push: entry_summary

# Error if next line doesn’t start with whitespace.
Expand All @@ -83,7 +83,7 @@ contexts:

entry_summary:
# Parse the remainder of the first line, and continue on the next.
- meta_scope: comment meta.klog.summary.text
- meta_scope: comment.klog entity.other.summary.text.klog
- include: tag

# Exit on blank line.
Expand All @@ -104,4 +104,4 @@ contexts:

tag:
- match: '\#[\p{L}\d_]+'
scope: comment meta.klog.summary.tag
scope: comment.klog entity.other.summary.tag.klog

0 comments on commit a40f6ab

Please sign in to comment.