mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-15 21:44:36 +03:00
Fully support non-ascii characters in Meter-Bar
Currently the code does not handle multi-byte characters, so length- computations take the raw count of C characters and not the to displayed size into account. An example is the degree sign for temperatures. Closes: #329
This commit is contained in:

committed by
cgzones

parent
c038326a70
commit
adf9185209
@ -119,6 +119,15 @@ void RichString_prune(RichString* this) {
|
||||
this->chptr = this->chstr;
|
||||
}
|
||||
|
||||
void RichString_appendChr(RichString* this, char c, int count) {
|
||||
int from = this->chlen;
|
||||
int newLen = from + count;
|
||||
RichString_setLen(this, newLen);
|
||||
for (int i = from; i < newLen; i++) {
|
||||
RichString_setChar(this, i, c);
|
||||
}
|
||||
}
|
||||
|
||||
void RichString_setAttr(RichString* this, int attrs) {
|
||||
RichString_setAttrn(this, attrs, 0, this->chlen - 1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user