Skip to content

Commit 081bbbf

Browse files
authored
Merge pull request #3021 from mgreter/bugfix/3018-nested-sel-nl-ws
Fix some nested mode indentation
2 parents a089875 + 5c267e1 commit 081bbbf

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/inspect.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ namespace Sass {
7272
append_indentation();
7373
append_token("@media", rule);
7474
append_mandatory_space();
75-
in_media_block = true;
76-
in_media_block = false;
7775
if (rule->block()) {
7876
rule->block()->perform(this);
7977
}
8078
}
8179

8280
void Inspect::operator()(CssMediaRule* rule)
8381
{
82+
if (output_style() == NESTED)
83+
indentation += rule->tabs();
8484
append_indentation();
8585
append_token("@media", rule);
8686
append_mandatory_space();
@@ -97,6 +97,9 @@ namespace Sass {
9797
if (rule->block()) {
9898
rule->block()->perform(this);
9999
}
100+
in_media_block = false;
101+
if (output_style() == NESTED)
102+
indentation -= rule->tabs();
100103
}
101104

102105
void Inspect::operator()(CssMediaQuery* query)
@@ -1056,6 +1059,9 @@ namespace Sass {
10561059
{
10571060
if (sel->hasPreLineFeed()) {
10581061
append_optional_linefeed();
1062+
if (!in_wrapped && output_style() == NESTED) {
1063+
append_indentation();
1064+
}
10591065
}
10601066
const SelectorComponent* prev = nullptr;
10611067
for (auto& item : sel->elements()) {

0 commit comments

Comments
 (0)