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:
parent
ac89e52109
commit
ac03806a50
|
@ -803,10 +803,14 @@ bool textarea_set_caret(struct textarea *ta, int caret)
|
||||||
ta->caret_y = y;
|
ta->caret_y = y;
|
||||||
|
|
||||||
if (textarea_scroll_visible(ta)) {
|
if (textarea_scroll_visible(ta)) {
|
||||||
|
/* Scrolled; redraw everything */
|
||||||
ta->redraw_request(ta->data, 0, 0,
|
ta->redraw_request(ta->data, 0, 0,
|
||||||
ta->vis_width,
|
ta->vis_width,
|
||||||
ta->vis_height);
|
ta->vis_height);
|
||||||
} else {
|
} else {
|
||||||
|
/* Just caret moved, redraw it */
|
||||||
|
x -= ta->scroll_x;
|
||||||
|
y -= ta->scroll_y;
|
||||||
x0 = max(x - 1, MARGIN_LEFT);
|
x0 = max(x - 1, MARGIN_LEFT);
|
||||||
y0 = max(y + text_y_offset, 0);
|
y0 = max(y + text_y_offset, 0);
|
||||||
x1 = min(x + 1, ta->vis_width - MARGIN_RIGHT);
|
x1 = min(x + 1, ta->vis_width - MARGIN_RIGHT);
|
||||||
|
|
Loading…
Reference in New Issue