jcs
/textview
/amendments
/71
TVAppendLocked: Fix incremental redraw on word-wrapping
jcs made amendment 71 about 1 month ago
--- textview.c Wed Oct 14 16:58:35 2026
+++ textview.c Wed Oct 14 17:13:23 2026
@@ -484,7 +484,7 @@ TVAppendLocked(struct TVRec *tv, struct TVStyle *style
RgnHandle vacated;
BigRect redraw;
Rect r;
- unsigned long avail, wastop;
+ unsigned long avail, wastop, fromend;
short width;
TVSlabLocator prev_style, prev_chunk_loc;
char *text_slab_data;
@@ -606,11 +606,8 @@ TVAppendLocked(struct TVRec *tv, struct TVStyle *style
else
r.bottom = tv->scrolled.top + redraw.bottom;
- /*
- * Text is normally drawn right over what's there, but if any of
- * it is highlighted it has to be erased first.
- */
TVRedrawRect(tv, &r, fromline ? fromline->nline : 0,
+ (fromline != NULL && fromline->end < fromend) ||
(tv->active && tv->sel_start != tv->sel_end &&
fromline != NULL && tv->sel_end > fromline->start));
}