-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a3ef3d8
commit 1f7f612
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
; inherits: go | ||
|
||
; [ | ||
; (component_block) | ||
; ] @indent.begin | ||
|
||
; ((tag_start) @indent.begin | ||
; (#set! indent.immediate 1)) | ||
; | ||
; ((tag_end) @indent.end) | ||
|
||
; (component_block | ||
; "{" @indent.branch) | ||
|
||
|
||
[ | ||
((element | ||
(tag_start | ||
(element_identifier) @_not_special)) | ||
(#not-any-of? @_not_special "meta" "link")) | ||
(element | ||
(self_closing_tag)) | ||
] @indent.begin | ||
|
||
; These tags are usually written one-lined and doesn't use self-closing tags so special-cased them | ||
; but add indent to the tag to make sure attributes inside them are still indented if written multi-lined | ||
((tag_start | ||
(element_identifier) @_special) | ||
(#any-of? @_special "meta" "link")) @indent.begin | ||
|
||
; These are the nodes that will be captured when we do `normal o` | ||
; But last element has already been ended, so capturing this | ||
; to mark end of last element | ||
(element | ||
(tag_end | ||
">" @indent.end)) | ||
|
||
(element | ||
(self_closing_tag | ||
"/>" @indent.end)) | ||
|
||
; Script/style elements aren't indented, so only branch the end tag of other elements | ||
(element | ||
(tag_end) @indent.branch) | ||
|
||
[ | ||
">" | ||
"/>" | ||
] @indent.branch |