From 492c870e8bc818cc0003c813df531fac6f94698d Mon Sep 17 00:00:00 2001 From: Marcel Greter Date: Fri, 19 Dec 2014 18:52:55 +0100 Subject: [PATCH] Fix for source-map issues https://github.com/sass/libsass/issues/720 --- inspect.cpp | 2 -- output_compressed.cpp | 8 ++++++-- output_nested.cpp | 6 ++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/inspect.cpp b/inspect.cpp index 8e67456c6b..cc246b9712 100644 --- a/inspect.cpp +++ b/inspect.cpp @@ -714,8 +714,6 @@ namespace Sass { void Inspect::append_to_buffer(const string& text) { buffer += text; - if (ctx && !ctx->_skip_source_map_update) - ctx->source_map.update_column(text); } } diff --git a/output_compressed.cpp b/output_compressed.cpp index 2a9693e33f..e36c97a5ee 100644 --- a/output_compressed.cpp +++ b/output_compressed.cpp @@ -27,6 +27,8 @@ namespace Sass { seen_utf8 = true; } buffer += text; + if (ctx && !ctx->_skip_source_map_update) + ctx->source_map.update_column(text); } void Output_Compressed::operator()(Import* imp) @@ -224,6 +226,8 @@ namespace Sass { seen_utf8 = true; } buffer += text; + if (ctx && !ctx->_skip_source_map_update) + ctx->source_map.update_column(text); } } @@ -382,6 +386,8 @@ namespace Sass { void Output_Compressed::append_singleline_part_to_buffer(const string& text) { buffer += text; + if (ctx && !ctx->_skip_source_map_update) + ctx->source_map.update_column(text); for(const char& chr : text) { // abort clause if (seen_utf8) break; @@ -390,8 +396,6 @@ namespace Sass { // singleton seen_utf8 = true; } - if (ctx && !ctx->_skip_source_map_update) - ctx->source_map.update_column(text); } } diff --git a/output_nested.cpp b/output_nested.cpp index e921cc7c9f..0641c53821 100644 --- a/output_nested.cpp +++ b/output_nested.cpp @@ -30,6 +30,8 @@ namespace Sass { seen_utf8 = true; } buffer += text; + if (ctx && !ctx->_skip_source_map_update) + ctx->source_map.update_column(text); } void Output_Nested::operator()(Import* imp) @@ -347,6 +349,8 @@ namespace Sass { void Output_Nested::append_to_buffer(const string& text) { buffer += text; + if (ctx && !ctx->_skip_source_map_update) + ctx->source_map.update_column(text); for(const char& chr : text) { // abort clause if (seen_utf8) break; @@ -355,8 +359,6 @@ namespace Sass { // singleton seen_utf8 = true; } - if (ctx && !ctx->_skip_source_map_update) - ctx->source_map.update_column(text); } }