> We can test it in tclearregion in this form: > > > > for(y = y1; y <= y2; y++) { > term.dirty[y] = 1; > for(x = x1; x <= x2; x++) { > if(selected(y, x)) > selclear(NULL); > term.line[y][x] = term.c.attr; > memcpy(term.line[y][x].c, " ", 2); > } > }
It is good, and it will catch almost cases, but we can lose other cases. Maybe it is better in drawregion: - check if it is selected - check if the previous content if different to new one - call to selclear