Skip to content

Commit

Permalink
add more list of maps to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dead10ck committed Apr 17, 2023
1 parent ff3b452 commit 15714ac
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 6 deletions.
64 changes: 64 additions & 0 deletions helix-term/tests/test/languages/yaml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,38 @@ async fn auto_indent() -> anyhow::Result<()> {
fook:
"}),
),
(
helpers::platform_line(indoc! {"\
- top:#[\n|]#
baz: foo
bax: foox
fook:
"}),
"o",
helpers::platform_line(indoc! {"\
- top:
#[\n|]#
baz: foo
bax: foox
fook:
"}),
),
(
helpers::platform_line(indoc! {"\
- top:
baz: foo#[\n|]#
bax: foox
fook:
"}),
"o",
helpers::platform_line(indoc! {"\
- top:
baz: foo
#[\n|]#
bax: foox
fook:
"}),
),
(
helpers::platform_line(indoc! {"\
- top:
Expand Down Expand Up @@ -604,6 +636,38 @@ async fn auto_indent() -> anyhow::Result<()> {
fook:
"}),
),
(
helpers::platform_line(indoc! {"\
- top:
baz: foo#[\n|]#
bax: foox
fook:
"}),
"O",
helpers::platform_line(indoc! {"\
- top:
#[\n|]#
baz: foo
bax: foox
fook:
"}),
),
(
helpers::platform_line(indoc! {"\
- top:
baz: foo
bax: foox
fook:#[\n|]#
"}),
"O",
helpers::platform_line(indoc! {"\
- top:
baz: foo
bax: foox
#[\n|]#
fook:
"}),
),
];

for test in above_tests {
Expand Down
9 changes: 3 additions & 6 deletions runtime/queries/yaml/indents.scm
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
(block_scalar) @indent @extend

((block_mapping_pair
key: (_) @key
value: (_)? @val
(#not-same-line? @key @val)
) @indent @extend
)
(block_mapping_pair) @indent

(block_sequence_item) @indent

0 comments on commit 15714ac

Please sign in to comment.