File tree 4 files changed +20
-13
lines changed
4 files changed +20
-13
lines changed Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ extern "C" {
154
154
ADDAPI const struct SassError * ADDCALL sass_compiler_get_error (struct SassCompiler * compiler );
155
155
156
156
// Returns status code for compiler (0 meaning success, anything else is an error)
157
- ADDAPI const int ADDCALL sass_compiler_get_status (struct SassCompiler * compiler );
157
+ ADDAPI int ADDCALL sass_compiler_get_status (struct SassCompiler * compiler );
158
158
159
159
/////////////////////////////////////////////////////////////////////////
160
160
/////////////////////////////////////////////////////////////////////////
Original file line number Diff line number Diff line change @@ -23,13 +23,14 @@ namespace Sass {
23
23
formatted << " Error: " ;
24
24
// Add message and ensure it is
25
25
// added with a final line-feed.
26
- if (what != nullptr ) {
27
- formatted << what;
28
- while (*what) {
26
+ const char * msg = what;
27
+ if (msg != nullptr ) {
28
+ formatted << msg;
29
+ while (*msg) {
29
30
has_final_lf =
30
- *what == ' \r ' ||
31
- *what == ' \n ' ;
32
- ++what ;
31
+ *msg == ' \r ' ||
32
+ *msg == ' \n ' ;
33
+ ++msg ;
33
34
}
34
35
if (!has_final_lf) {
35
36
formatted << STRMLF;
@@ -563,7 +564,7 @@ extern "C" {
563
564
}
564
565
565
566
// Returns status code for compiler (0 meaning success, anything else is an error)
566
- const int ADDCALL sass_compiler_get_status (struct SassCompiler * compiler)
567
+ int ADDCALL sass_compiler_get_status (struct SassCompiler * compiler)
567
568
{
568
569
return Compiler::unwrap (compiler).error .status ;
569
570
}
Original file line number Diff line number Diff line change @@ -16,25 +16,31 @@ namespace Sass {
16
16
columns (columns),
17
17
style (style)
18
18
{
19
- setLogStyle (style);
19
+ setLogStyle (style, columns );
20
20
}
21
21
22
- void Logger::setLogStyle (enum SassLoggerStyle style)
22
+ void Logger::setLogStyle (enum SassLoggerStyle style, size_t columns )
23
23
{
24
24
// This auto-detection is experimental
25
25
// We do our best but hard to make portable
26
- if (this -> style == SASS_LOGGER_AUTO) {
26
+ if (style == SASS_LOGGER_AUTO) {
27
27
auto colors = Terminal::hasColorSupport (true );
28
28
bool unicode = Terminal::hasUnicodeSupport (true );
29
29
if (colors && unicode) { this ->style = SASS_LOGGER_UNICODE_COLOR; }
30
30
else if (unicode) { this ->style = SASS_LOGGER_UNICODE_MONO; }
31
31
else if (colors) { this ->style = SASS_LOGGER_ASCII_COLOR; }
32
32
else { this ->style = SASS_LOGGER_ASCII_MONO; }
33
33
}
34
+ else {
35
+ this ->style = style;
36
+ }
34
37
// Auto-detect available columns
35
38
if (columns == NPOS) {
36
39
this ->columns = Terminal::getColumns (true );
37
40
}
41
+ else {
42
+ this ->columns = columns;
43
+ }
38
44
// Clamp into a sensible range
39
45
if (columns > 800 ) { columns = 800 ; }
40
46
else if (columns < 40 ) { columns = 40 ; }
Original file line number Diff line number Diff line change @@ -92,9 +92,9 @@ namespace Sass {
92
92
Logger (enum SassLoggerStyle style = SASS_LOGGER_ASCII_MONO,
93
93
int precision = SassDefaultPrecision, size_t columns = NPOS);
94
94
95
- void setLogPrecision ( int precision );
95
+ void setLogStyle ( enum SassLoggerStyle style, size_t columns = NPOS );
96
96
97
- void setLogStyle ( enum SassLoggerStyle style );
97
+ void setLogPrecision ( int precision );
98
98
99
99
void addWarning (const sass::string& message);
100
100
You can’t perform that action at this time.
0 commit comments