for(line = this.lines.first; line; line = line.next)
{
- if(style.syntax && line.count && isspace(line.buffer[line.count-1]))
- {
- int c = 0;
- for(c=line.count-2; c>=-1; c--)
- {
- if(c == -1 || !isspace(line.buffer[c]))
- {
- c++;
- line.buffer[c] = '\0';
- line.count -= (line.count - c);
- break;
- }
- }
- }
- f.Write(line.buffer, line.count,1);
+ f.Write(line.buffer, line.count, 1);
if(line.next)
{
if(cr) f.Putc('\r');
designer.fileName = fileName;
designer.modifiedDocument = false;
}
+
+ if(editBox.syntaxHighlighting)
+ {
+ // Nuke trailing spaces
+ EditLine line;
+ int y = 0;
+ for(line = editBox.firstLine; line; line = line.next, y++)
+ {
+ String buffer = line.text;
+ int count = line.count, i = count-1;
+ while(i > 0 && isspace(buffer[i])) i--;
+ if(i < count - 1)
+ editBox.Delete(line, y, i, line, y, count);
+ }
+ }
+
editBox.Save(f, false);
modifiedDocument = false;