The traditional method for scroll+sweep is to transpose the background and foreground colors during insertion of new text. This is because the new text is being selected, so there is no need to highlight it again (just insert it with the right color in the first place). Currently, the logic in frame/win doesn't account for that. Text is inserted with the regular text color, and then repainted (which essentially means redrawn). A trivial performance improvement can be ascertained by fixing this.
The traditional method for scroll+sweep is to transpose the background and foreground colors during insertion of new text. This is because the new text is being selected, so there is no need to highlight it again (just insert it with the right color in the first place). Currently, the logic in frame/win doesn't account for that. Text is inserted with the regular text color, and then repainted (which essentially means redrawn). A trivial performance improvement can be ascertained by fixing this.