Skip to content

Commit d97415f

Browse files
matteocoderdeathaxe
and
deathaxe
authored
Revise matching regexes and scoping for regions
Co-authored-by: deathaxe <[email protected]>
1 parent 76acf11 commit d97415f

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

PowerShell.sublime-syntax

+13-14
Original file line numberDiff line numberDiff line change
@@ -811,17 +811,16 @@ contexts:
811811
- include: comment-line
812812

813813
regions:
814-
- match: ^\s*(#)\s*(region)\b\s*(\S.*)
815-
captures:
816-
1: punctuation.definition.comment.powershell
817-
2: comment.line.powershell
818-
3: meta.toc-list.powershell meta.fold.begin.powershell entity.name.section.powershell
819-
- match: '^\s*(#)\s*(region)\b\s*'
820-
captures:
821-
1: punctuation.definition.comment.powershell
822-
2: comment.line.powershell meta.fold.begin.powershell
823-
- match: '^\s*(#)\s*(endregion\b[^\S\n]*.*)($\n?)'
824-
captures:
825-
1: punctuation.definition.comment.powershell
826-
2: comment.line.powershell
827-
3: meta.fold.end.powershell
814+
- match: ^\s*((#)\s*(region\b)(?:\s*(\S.*))?(\n?))
815+
captures:
816+
1: comment.line.powershell
817+
2: punctuation.definition.comment.powershell
818+
3: keyword.other.region.begin.powershell
819+
4: meta.toc-list.powershell entity.name.section.powershell
820+
5: meta.fold.begin.powershell
821+
- match: ^\s*((#)\s*(endregion\b).*(\n?))
822+
captures:
823+
1: comment.line.powershell
824+
2: punctuation.definition.comment.powershell
825+
3: keyword.other.region.end.powershell
826+
4: meta.fold.end.powershell

0 commit comments

Comments
 (0)