From: Simon Glass <simon.glass@canonical.com> The current code is written to suggest that the cursor position (priv->pos_ptr) might be respected. In fact a bug means that it never is, since index is set to priv->pos_ptr, so the if() condition always fails. Further, when editing textline objects, the cursor index is always the same as priv->pos_ptr anyway. Fix the bug but keep the current behaviour, adding a comment for future readers. Signed-off-by: Simon Glass <simon.glass@canonical.com> --- drivers/video/console_truetype.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/video/console_truetype.c b/drivers/video/console_truetype.c index 4ddf133f2e0..7f5a2262b17 100644 --- a/drivers/video/console_truetype.c +++ b/drivers/video/console_truetype.c @@ -1097,9 +1097,13 @@ static int truetype_get_cursor_info(struct udevice *dev) * figure out where to place the cursor. This driver ignores the * passed-in values, since an entry_restore() must have been done before * calling this function. + * + * A current quirk is that the cursor is always at xcur_frac, since we + * output characters directly to the console as they are typed by the + * user. So we never bother with priv->pos[index] for now. */ index = priv->pos_ptr; - if (index < priv->pos_ptr) + if (0 && index < priv->pos_count) x = VID_TO_PIXEL(priv->pos[index].xpos_frac); else x = VID_TO_PIXEL(vc_priv->xcur_frac); -- 2.43.0