timers work, fix crash when vscode window closes after timeout
This commit is contained in:
@@ -41,6 +41,12 @@ class StringHelper {
|
||||
if (input.length() <= maxSize) {
|
||||
return input;
|
||||
}
|
||||
return input.substr(0, maxSize) + "...";
|
||||
|
||||
size_t len = maxSize;
|
||||
while (len > 0 && (static_cast<unsigned char>(input[len]) & 0xC0) == 0x80) {
|
||||
len--;
|
||||
}
|
||||
|
||||
return input.substr(0, len) + "...";
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user