mirror of
https://github.com/aristocratos/btop.git
synced 2024-06-18 18:34:36 +12:00
Fixed: Logic of Fx::uncolor()
This commit is contained in:
parent
932bb15e79
commit
897769a90d
|
@ -148,12 +148,12 @@ namespace Fx {
|
|||
if (start_pos == string::npos)
|
||||
break;
|
||||
offset = start_pos + 1;
|
||||
for (end_pos = out.find('m', offset); end_pos != string::npos and not isdigit(out.at(end_pos - 1)); end_pos = out.find('m', end_pos + 1));
|
||||
end_pos = out.find('m', offset);
|
||||
if (end_pos == string::npos)
|
||||
break;
|
||||
else if (auto next_pos = out.find('\x1b', offset); end_pos >= next_pos) {
|
||||
continue;
|
||||
}
|
||||
else if (auto next_pos = out.find('\x1b', offset); not isdigit(out[end_pos - 1]) or end_pos > next_pos)
|
||||
continue;
|
||||
|
||||
out.erase(start_pos, (end_pos - start_pos)+1);
|
||||
offset = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue