Fix redraw of caret when scroll offsets are non-zero, only caret has moved, and we're not getting a full textarea redraw.

This commit is contained in:
Michael Drake 2013-01-10 23:21:47 +00:00
parent ac89e52109
commit ac03806a50
1 changed files with 4 additions and 0 deletions

View File

@ -803,10 +803,14 @@ bool textarea_set_caret(struct textarea *ta, int caret)
ta->caret_y = y;
if (textarea_scroll_visible(ta)) {
/* Scrolled; redraw everything */
ta->redraw_request(ta->data, 0, 0,
ta->vis_width,
ta->vis_height);
} else {
/* Just caret moved, redraw it */
x -= ta->scroll_x;
y -= ta->scroll_y;
x0 = max(x - 1, MARGIN_LEFT);
y0 = max(y + text_y_offset, 0);
x1 = min(x + 1, ta->vis_width - MARGIN_RIGHT);