Skip to content

Commit 6892bf5

Browse files
authored
Merge pull request #2540 from mgreter/bugfix/sourcemap/crutch
Fix sourcemap crutch once again
2 parents 7e51af2 + 7e3feca commit 6892bf5

File tree

4 files changed

+18
-15
lines changed

4 files changed

+18
-15
lines changed

src/ast.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,12 +1322,12 @@ namespace Sass {
13221322
ss->head(NULL);
13231323
}
13241324
// adjust for parent selector (1 char)
1325-
if (h->length()) {
1326-
ParserState state(h->at(0)->pstate());
1327-
state.offset.column += 1;
1328-
state.column -= 1;
1329-
(*h)[0]->pstate(state);
1330-
}
1325+
// if (h->length()) {
1326+
// ParserState state(h->at(0)->pstate());
1327+
// state.offset.column += 1;
1328+
// state.column -= 1;
1329+
// (*h)[0]->pstate(state);
1330+
// }
13311331
// keep old parser state
13321332
s->pstate(pstate());
13331333
// append new tail
@@ -1360,12 +1360,12 @@ namespace Sass {
13601360
// \/ IMO ruby sass bug \/
13611361
ss->has_line_feed(false);
13621362
// adjust for parent selector (1 char)
1363-
if (h->length()) {
1364-
ParserState state(h->at(0)->pstate());
1365-
state.offset.column += 1;
1366-
state.column -= 1;
1367-
(*h)[0]->pstate(state);
1368-
}
1363+
// if (h->length()) {
1364+
// ParserState state(h->at(0)->pstate());
1365+
// state.offset.column += 1;
1366+
// state.column -= 1;
1367+
// (*h)[0]->pstate(state);
1368+
// }
13691369
// keep old parser state
13701370
s->pstate(pstate());
13711371
// append new tail

src/emitter.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ namespace Sass {
1414
scheduled_space(0),
1515
scheduled_linefeed(0),
1616
scheduled_delimiter(false),
17+
scheduled_crutch(0),
1718
scheduled_mapping(0),
1819
in_custom_property(false),
1920
in_comment(false),
@@ -162,9 +163,9 @@ namespace Sass {
162163
add_open_mapping(node);
163164
// hotfix for browser issues
164165
// this is pretty ugly indeed
165-
if (scheduled_mapping) {
166-
add_open_mapping(scheduled_mapping);
167-
scheduled_mapping = 0;
166+
if (scheduled_crutch) {
167+
add_open_mapping(scheduled_crutch);
168+
scheduled_crutch = 0;
168169
}
169170
append_string(text);
170171
add_close_mapping(node);

src/emitter.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ namespace Sass {
3737
size_t scheduled_space;
3838
size_t scheduled_linefeed;
3939
bool scheduled_delimiter;
40+
AST_Node_Ptr scheduled_crutch;
4041
AST_Node_Ptr scheduled_mapping;
4142

4243
public:

src/output.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ namespace Sass {
134134
append_string(ss.str());
135135
append_optional_linefeed();
136136
}
137+
scheduled_crutch = s;
137138
if (s) s->perform(this);
138139
append_scope_opener(b);
139140
for (size_t i = 0, L = b->length(); i < L; ++i) {

0 commit comments

Comments
 (0)