]> git.neil.brown.name Git - edlib.git/commitdiff
render-lines: update ->cursor_line *after* calling draw_line
authorNeilBrown <neil@brown.name>
Sun, 28 Mar 2021 01:42:19 +0000 (12:42 +1100)
committerNeilBrown <neil@brown.name>
Sun, 28 Mar 2021 03:08:15 +0000 (14:08 +1100)
draw_line() might change ->cy, so we should update rl->cursor_line
after the call, not before.

Signed-off-by: NeilBrown <neil@brown.name>
render-lines.c

index 6c4c6ee3a6bc6c867ce22fddc3bb28e4a1f87437..085e9050892bf5286c4d190a249ac00120a93d46 100644 (file)
@@ -712,8 +712,8 @@ static int render(struct mark *pm, struct pane *p safe,
                     mark_ordered_not_same(pm, m2))) {
                        short len = call_render_line_to_point(focus, pm,
                                                              m);
-                       rl->cursor_line = m->mdata->y + m->mdata->cy;
                        draw_line(p, focus, m, len);
+                       rl->cursor_line = m->mdata->y + m->mdata->cy;
 
                        cursor_drawn = 1;
                } else {