Skip to content

Commit 1e3db6b

Browse files
committed
Merge pull request #1039 from mgreter/bugfix/issue_1025
Fix minor white-space issue with wrapped selectors
2 parents 0b0a449 + ed30ce5 commit 1e3db6b

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

emitter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace Sass {
1515
scheduled_linefeed(0),
1616
scheduled_delimiter(false),
1717
in_comment(false),
18-
in_at_rule(false),
18+
in_wrapped(false),
1919
in_media_block(false),
2020
in_declaration(false),
2121
in_declaration_list(false)

emitter.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ namespace Sass {
3838

3939
public:
4040
bool in_comment;
41-
bool in_at_rule;
41+
bool in_wrapped;
4242
bool in_media_block;
4343
bool in_declaration;
4444
bool in_declaration_list;

inspect.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ namespace Sass {
103103
append_token(at_rule->keyword(), at_rule);
104104
if (at_rule->selector()) {
105105
append_mandatory_space();
106-
in_at_rule = true;
106+
in_wrapped = true;
107107
at_rule->selector()->perform(this);
108-
in_at_rule = false;
108+
in_wrapped = false;
109109
}
110110
if (at_rule->block()) {
111111
at_rule->block()->perform(this);
@@ -791,9 +791,12 @@ namespace Sass {
791791

792792
void Inspect::operator()(Wrapped_Selector* s)
793793
{
794+
bool was = in_wrapped;
795+
in_wrapped = true;
794796
append_token(s->name(), s);
795797
s->selector()->perform(this);
796798
append_string(")");
799+
in_wrapped = was;
797800
}
798801

799802
void Inspect::operator()(Compound_Selector* s)
@@ -848,7 +851,7 @@ namespace Sass {
848851
{
849852
if (g->empty()) return;
850853
for (size_t i = 0, L = g->length(); i < L; ++i) {
851-
if (!in_at_rule && i == 0) append_indentation();
854+
if (!in_wrapped && i == 0) append_indentation();
852855
(*g)[i]->perform(this);
853856
if (i < L - 1) {
854857
append_comma_separator();

output.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,9 @@ namespace Sass {
337337
append_token(kwd, a);
338338
if (s) {
339339
append_mandatory_space();
340-
in_at_rule = true;
340+
in_wrapped = true;
341341
s->perform(this);
342-
in_at_rule = false;
342+
in_wrapped = false;
343343
}
344344
else if (v) {
345345
append_mandatory_space();

0 commit comments

Comments
 (0)