Doing an AddText() on a TextArea doesn't show
newlines, as a byproduct of how the line vector gets
built (the strtok invocation in AddText() eats up
newlines).
Here's my fix (against version 0.78.2):
void TextArea::AddText(const char *text) {
char *tok;
char *copy;
char *temp;
copy = new char[ustrsizez(text)];
ustrcpy(copy, text);
temp = copy;
while (*temp == '\n')
{
string s = "";
lines.push_back(s);
temp++;
}
tok = ustrtok(temp, "\n");
while (tok) {
string s = tok;
lines.push_back(s);
temp += ustrsizez(tok);
while ((*temp == '\n') && (*temp !
= '\0'))
{
string s = "";
lines.push_back(s);
temp++;
}
if (*temp == '\0')
{
break;
}
tok = ustrtok(temp, "\n");
}
CalculateRange();
delete [] copy;
}