@@ -2415,8 +2415,10 @@ namespace Sass {
2415
2415
{
2416
2416
int max_len = 14 ;
2417
2417
const char * pos = peek < optional_spaces >();
2418
+ // backup position to last significant char
2419
+ while (!*pos || Prelexer::is_space (*pos)) -- pos;
2418
2420
bool ellipsis_left = false ;
2419
- const char * pos_left (pos - 1 );
2421
+ const char * pos_left (pos + 1 );
2420
2422
if (pos_left < source) pos_left = source;
2421
2423
while (*pos_left && pos_left > source) {
2422
2424
if (pos - pos_left > max_len) {
@@ -2426,23 +2428,21 @@ namespace Sass {
2426
2428
const char * prev = pos_left - 1 ;
2427
2429
if (*prev == ' \r ' ) break ;
2428
2430
if (*prev == ' \n ' ) break ;
2429
- if (*prev == 10 ) break ;
2430
2431
pos_left = prev;
2431
2432
}
2432
2433
bool ellipsis_right = false ;
2433
- const char * pos_right (pos);
2434
+ const char * pos_right (pos + 1 );
2434
2435
while (*pos_right && pos_right <= end) {
2435
2436
if (pos_right - pos > max_len) {
2436
2437
ellipsis_right = true ;
2437
2438
break ;
2438
2439
}
2439
2440
if (*pos_right == ' \r ' ) break ;
2440
2441
if (*pos_right == ' \n ' ) break ;
2441
- if (*pos_left == 10 ) break ;
2442
2442
++ pos_right;
2443
2443
}
2444
- std::string left (pos_left, pos);
2445
- std::string right (pos, pos_right);
2444
+ std::string left (pos_left, pos + 1 );
2445
+ std::string right (pos + 1 , pos_right);
2446
2446
if (ellipsis_left) left = ellipsis + left;
2447
2447
if (ellipsis_right) right = right + ellipsis;
2448
2448
// now pass new message to the more generic error function
0 commit comments